GithubHelp home page GithubHelp logo

csnotificationview's People

Contributors

bcylin avatar dlackty avatar dongxinb avatar fouquet avatar jeehut avatar problame avatar ryanbertrand avatar trisix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

csnotificationview's Issues

Notification is displaying behind the Navigationbar.

I have one Side Panel View controller
that contains one CenterPanel (TabBarController) and SidePanel- (ViewController)
Tab Bar controller contains two NavigationController each having one ViewController.

Is there any way to bring notification to front.

Visual bug on modal dialog (iPad)

I think the status bar height is hard coded, so it looks weird on a modal dialog (form sheet) on iPad.

ipad-bug

Any idea on how to fix that properly?

README.md

Use these screenshots when writing a README.md:

ios simulator screen shot 18 09 2013 21 23 30
ios simulator screen shot 18 09 2013 21 23 34
ios simulator screen shot 18 09 2013 21 23 36

Better exclamation mark icon

The current exclamation mark is OK but not good.
In particular, I find it too bold for iOS 7.
In addition, the exclamation mark and it's frame is are too close.

If there's anybody out there who has any talent regarding icon design and probably five minutes of time: I beg you, help us!

Does not seem to work with static tableviews (scroll problems )

Once a CSNotification is shown from a UITableViewController with static cells, tableview can no longer scroll to the bottom: scrolling bounces back and hides the bottom cells (as though its content size or frame is incorrenct). Scrolling works as expected until CSNotification is first called from the view controller.
Tableviews with dynamic cells seems to work properly.

Wrong CSNotification dismissing on iPhone 6 iOS 8.1

HI there,
I was using CSNotificationView in my app, now I'm working on the iPhone 6 version and I found a weird behaviour on iOS 8.1.
When the notification tries to expire (in my use case I had an error notification, so red background), what I get is a jump of the label on top of the notification view while the view moves down and up. At the end of the animation the notification view disappear as expected.
To better clarify, have a look at the debug image in which I collected all the screenshots taken from the simulator. Please note, I had the same behaviour on device.

Cheers,
mulp
debug_img

Warning Getter name mismatch

CSNotificationView_Private.h:34:1: Getter name mismatch between property redeclaration ('isVisible') and its original declaration ('isShowing')

Hide Card on Demand

Let the user show the card on request, and hide it on demand. This way, it can act like a progress Indicator.

Since ver. 0.5 build fails: Cannot find interface declaration for 'UIVisualEffectView', superclass of 'CSNativeBlurView'

Pods/CSNotificationView/CSNotificationView/CSNativeBlurView.h:12:31: Cannot find interface declaration for 'UIVisualEffectView', superclass of 'CSNativeBlurView'

Pods/CSNotificationView/CSNotificationView/CSNotificationView.m:13:9: In file included from Pods/CSNotificationView/CSNotificationView/CSNotificationView.m:13:

Pods/CSNotificationView/CSNotificationView/CSNativeBlurView.m:25:35: Use of undeclared identifier 'UIBlurEffect'

Make blur effect implementation interchangeable

The blur effect always has to a subview of CSNotificationView.

Depending on the OS version, either the old layer-stealing or the new UIVisualEffectView will be used.

The implementations should be encapsulated in a subclass. This allows adoption of other effect views such as FXBlurView later.

Requires restructuring large parts of the project.

Ability to show a UIActivityIndicatorView instead of an icon.

The currently used private imageView must be replaced by a generic UIView symbolView.
Then, the setter of image must be overridden: it will generate a UIImageView on demand and set the symbolView property.
Then, there can be an additional method for setting a UIActivityIndicatorView as symbolicView.

Non-full-screen Container View Controllers

As documented in the discussion in #57 and #56, CSNotificationView is displayed with the status bar offset in a container view controller.

The key point is: CSNotificationView cannot always rely on the layout guides provided by the view controllers it is presented in. (Details in the comments on #57):

Hence, it has a method that calculates the .length property of what would normally be the topLayoutGuide, taking into account

  • the status bar height
  • if the parent UINavgiationController has its navigation bar visible or not

This behavior breaks in Container View Controllers that are not full-screen and also in modal Form-Style View Controllers on iPad.

The main author (me) does not have the time to fix this bug properly. I would appreciate pull requests that if possible maintain backwards-compatibility.

Crashes with Key-Value-Observing

There are crashes related to CSNotificationView being reported to me since 0.4 (commit 54ea081).

There is EXC_BAD_ACCESS KERN_PROTECTION_FAILURE after the following to methods are called over and over again - with some UIKit stuff in between:


0   CoreFoundation                 0x0000000189e749f4 -[NSArray isEqualToArray:] + 48
1   CoreFoundation                 0x0000000189e749b8 -[NSArray isEqual:] + 96
2   CoreFoundation                 0x0000000189e749b8 -[NSArray isEqual:] + 96
3   UIKit                          0x000000018d026d20 -[UINavigationBar _setItems:transition:] + 128
4   UIKit                          0x000000018d1f281c -[UINavigationController _updateNavigationBarItems:] + 160
5   UIKit                          0x000000018cf80058 -[UINavigationController loadView] + 288
6   UIKit                          0x000000018ceec488 -[UIViewController loadViewIfRequired] + 88
7   UIKit                          0x000000018ceec3f4 -[UIViewController view] + 32

8   MYAPP                            0x00000001001508c8 -[CSNotificationView hiddenFrame] (CSNotificationView.m:416)
9   MYAPP                            0x000000010014f654 -[CSNotificationView observeValueForKeyPath:ofObject:change:context:] (CSNotificationView.m:237)
10  Foundation                     0x000000018a9cddf4 NSKeyValueNotifyObserver + 340
11  Foundation                     0x000000018a9cd924 NSKeyValueDidChange + 432
12  Foundation                     0x000000018a9b6544 -[NSObject(NSKeyValueObserverNotification) didChangeValueForKey:] + 116
13  UIKit                          0x000000018cf8376c -[UINavigationController _positionNavigationBarHidden:edge:initialOffset:] + 428
14  UIKit                          0x000000018cf8355c -[UINavigationController _positionNavigationBarHidden:edge:] + 152
15  UIKit                          0x000000018cf800a4 -[UINavigationController loadView] + 364
16  UIKit                          0x000000018ceec488 -[UIViewController loadViewIfRequired] + 88
17  UIKit                          0x000000018ceec3f4 -[UIViewController view] + 32

18  MYAPP                            0x00000001001508c8 -[CSNotificationView hiddenFrame] (CSNotificationView.m:416)
19  MYAPP                            0x000000010014f654 -[CSNotificationView observeValueForKeyPath:ofObject:change:context:] (CSNotificationView.m:237)
20  Foundation                     0x000000018a9cddf4 NSKeyValueNotifyObserver + 340
21  Foundation                     0x000000018a9cd924 NSKeyValueDidChange + 432
22  Foundation                     0x000000018a9b6544 -[NSObject(NSKeyValueObserverNotification) didChangeValueForKey:] + 116
23  UIKit                          0x000000018cf8376c -[UINavigationController _positionNavigationBarHidden:edge:initialOffset:] + 428
24  UIKit                          0x000000018cf8355c -[UINavigationController _positionNavigationBarHidden:edge:] + 152
25  UIKit                          0x000000018cf800a4 -[UINavigationController loadView] + 364
26  UIKit                          0x000000018ceec488 -[UIViewController loadViewIfRequired] + 88
27  UIKit                          0x000000018ceec3f4 -[UIViewController view] + 32
...

These crashes appear mostly when the app logic wants to present a CSNotificationView but the app's views etc. are not fully initialized yet.

I think that's why we see such a repeating schema of -[UIViewController view] being called.

In addition, this has something to to with KVO (hence: the calls to -[CSNotificationView observeValueForKeyPath:ofObject:change:context:] )

Do you have any idea what could be behind all this?

Cannot modify textLabel for activity example from README

From the activity example:

CSNotificationView* note = (...);
note.showingActivity = YES;

[note setVisible:YES animated:YES completion:nil];
(...)
[note dismissWithStyle:CSNotificationViewStyleSuccess message:@"Success!"
          duration:kCSNotificationViewDefaultShowDuration animated:YES];

If I created the view with _progressNotification = [[CSNotificationView alloc] initWithParentViewController:_topVC]; I am unable to set the textLabel.

Move presentation to instance methods

Create separate instance methods for showing and dismissing the view.
These methods should have a paramter animated like many other UIKit methods have.
There should be easy options to determine whether the view is currently animating or not --> animationState property.

CocoaPods

Create podspec and submit project to CocoaPods.

CSNotificationView/CSNotificationView.m:385:100: 'sharedApplication' is unavailable

Semantic issue

.../CSNotificationView/CSNotificationView.m:385: 100 : 'sharedApplication' is unavailable: not available on iOS (App Extension) - Use view controller based solutions where appropriate instead.

CGFloat top = MIN([UIApplication sharedApplication].statusBarFrame.size.height, [UIApplication sharedApplication].statusBarFrame.size.width);

Weird animation behaviour after updating to Xcode6

Hi, I have notice there's some weird animation behaviour going on with my notification after upgrading to XCode6. What it basically do is that it will kind of move downwards quickly before dismissed.

Before dismissing. the notification is at the navigation bar.

img_0017

When dismissing. The notification kind of move downward far from the navigation bar before dismissing.

img_0026

Not sure what caused this. I use the basic code to call it.

[CSNotificationView showInViewController:[self navigationController]
    style:CSNotificationViewStyleSuccess message:@"Item addded to your cart."];

add IOS6 Compatibility

Did some attempts to support ios 6:
//Change UIToolBar Appearance
[UIToolbar appearance] setBackgroundImage: [clear image]];

//Textlabel
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0")) {
UIFontDescriptor* textLabelFontDescriptor = [UIFontDescriptor preferredFontDescriptorWithTextStyle:UIFontTextStyleBody];
_textLabel.font = [UIFont fontWithDescriptor:textLabelFontDescriptor size:17.0f];
}
_textLabel.backgroundColor = [UIColor clearColor];

//setTintColor
if (SYSTEM_VERSION_LESS_THAN(@"7.0")) {
[self.toolbar setBackgroundColor:tintColor];
}else{
[self.toolbar setBarTintColor:tintColor];
}

  • (UIColor *)tintColor
    {
    if (SYSTEM_VERSION_LESS_THAN(@"7.0")) {
    return self.toolbar.backgroundColor;
    }else{
    return self.toolbar.barTintColor;
    }

}
//visibleFrame
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0")) {
displayFrame = CGRectMake(0, 0, CGRectGetWidth(viewController.view.frame),
kCGNotificationViewHeight + viewController.topLayoutGuide.length);
}else{
displayFrame = CGRectMake(0, 0, CGRectGetWidth(viewController.view.frame),
kCGNotificationViewHeight + 0);

}

//hiddenFrame
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0")) {
offscreenFrame = CGRectMake(0, -kCGNotificationViewHeight - viewController.topLayoutGuide.length,
CGRectGetWidth(viewController.view.frame),
kCGNotificationViewHeight + viewController.topLayoutGuide.length);
}else{
offscreenFrame = CGRectMake(0, -kCGNotificationViewHeight,
CGRectGetWidth(viewController.view.frame),
kCGNotificationViewHeight);
}

Everything seems to be working fine.

iOS 6 Compatibility

Is there any plan for extending compatibility with iOS 6? such as displaying a non transparent notification in iOS 6?

Does not handle device rotation

Either the view needs to have autolayout constraints added or it needs to manually adjust its layout when the device is rotated. It sorta half-works in that it appears in the correct position after rotation, however its width (and I think also height) is not adjusting.

NavigationController with navigationBarHidden

When used in a NavigationController-based views, if the navigation bar is hidden, the notification view is present over the status bar, and this may caused to be rejected by apple.

App crashes with modally presented UINavigationViewController in iOS 8

If I present a UINavigationViewController, show a CSNotificationView view within this modal view controller and dismiss the modal view controller during the CSNotificationView's presentation time, then I receive the following error in iOS 8:

Fatal Exception: NSInternalInconsistencyException
An instance 0x[...] of class UINavigationBar was deallocated while key value observers were still registered with it. Current observation info: <NSKeyValueObservationInfo 0x[...]> ( <NSKeyValueObservance 0x[...]: Observer: 0x[...], Key path: bounds, Options: <New: YES, Old: NO, Prior: NO> Context: 0x[...], Property: 0x[...]> )

By the way:
The reason why a CSNotificationView might be present on dismiss is that I use CSNotificationView to show Push Notifications when the App is in the foreground. So a CSNotificationView might be added at all times.

Bug in animating out in iOS 8

I'm using CSNotificationView in iOS 8 and when I show an error notification in a view without UINavigationController then all looks fine when presenting the notification, but when the notification disappears there is a bug: The Background color of the notification goes down at the beginning of the animation.

Here's a screen recording taken from the Simulator with the "Slow Animations" toggle set:
https://www.dropbox.com/s/1piferr0c2hydzy/CSNotificationView%20Bug%20iOS8.mov

Adjust font and icon color based on blurTintColor

The font is always white by default. It should adjust dynamically to the color / brightness of the blurTintColor property.

I don't know how to automatically find a nice color, but if you implement it, use KVO ;)

XCode7 (GM): compiler warnings

CSNotificationView/CSNotificationView.m:15:17: Method override for the designated initializer of the superclass '-initWithFrame:' not found

Queuing / Stacking

Right now, when calling showInViewController:... a second time while the first view is still being presented, the new view moves over the old one - not so great.

My idea:

1: Queuing
One could create a queue as a static object of CSNotificationView which holds track of all notifications to show per view controller.
Problem: If there are many notifications stacking, the delay is too long, showing the notification might confuse the user.

2: Queuing + Stacking
Given that there won't be two or three notifications showing in the same time, one could build up a stack inspired by in Apple's Passbook: New notifications appear a bit lower than the previous one and move up when the old is dismissed.
Implementing simple user interaction allowing to kick the view out earlier (--> UIKit Dynamics) might improve UX.

Unable to simultaneously satisfy constraints ranomly

CSNotificationView disappears randomly

 Unable to simultaneously satisfy constraints.
    Probably at least one of the constraints in the following list is one you don't want. 
    Try this: 
        (1) look at each constraint and try to figure out which you don't expect; 
        (2) find the code that added the unwanted constraint or constraints and fix it. 
    (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints) 
(
    "<NSAutoresizingMaskLayoutConstraint:0x1f524250 h=-&- v=--& CSNotificationView:0x141d72c0.width == UIView:0x15944d40.width - 320>",
    "<NSLayoutConstraint:0x1f524550 H:|-(4)-[UIActivityIndicatorView:0x1d836340]   (Names: '|':CSNotificationView:0x141d72c0 )>",
    "<NSLayoutConstraint:0x1f524510 H:[UIActivityIndicatorView:0x1d836340(44)]>",
    "<NSLayoutConstraint:0x1f5244d0 H:[UIActivityIndicatorView:0x1d836340]-(5)-[UILabel:0x1d8364c0'Establishing...']>",
    "<NSLayoutConstraint:0x1f524490 H:[UILabel:0x1d8364c0'Establishing...']-(10)-|   (Names: '|':CSNotificationView:0x141d72c0 )>",
    "<NSLayoutConstraint:0x1f524150 'UIView-Encapsulated-Layout-Width' H:[UIView:0x15944d40(320)]>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x1f5244d0 H:[UIActivityIndicatorView:0x1d836340]-(5)-[UILabel:0x1d8364c0'Establishing ...']>

Sample:

      let loader = CSNotificationView(parentViewController: self,
                                  tintColor: UIColor(red: 0, green: 0, blue: 0, alpha: 0.1),
                                  image: nil,
                                  message: message)
      loader.showingActivity = true
      loader.setVisible(true, animated: true, completion: nil)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.