GithubHelp home page GithubHelp logo

cezarywojcik / cwstatusbarnotification Goto Github PK

View Code? Open in Web Editor NEW
2.0K 2.0K 261.0 6.7 MB

A library that allows you to easily create text-based notifications that appear on the status bar.

License: MIT License

Objective-C 97.86% Ruby 2.14%

cwstatusbarnotification's People

Contributors

4ndrey avatar adamtootle avatar adomanico avatar avgx avatar benguild avatar cezarywojcik avatar dannybabiy avatar ddwang avatar drumnkyle avatar epologee avatar lswith avatar moskvin avatar rolandasrazma avatar stephenparish 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  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

cwstatusbarnotification's Issues

CRITICAL: Notifications Disable All Touches on iOS 7

It seems that while a notification is active on iOS 7 only, the window stops responding to touch events.

Steps to reproduce:

  1. Display a Notification for 60 seconds
  2. Observe touches are ignored everywhere else on the window.

This only happens on iOS 7 devices

Support Carthage

Please support Carthage on the Swift 2 branch. You just need to share the build scheme and push it. Thanks!

How to push the specified controller ?

self.notification.notificationTappedBlock = ^(void) {
if (!weakSelf.notification.notificationIsDismissing)
{
[weakSelf.notification dismissNotification];
// how to do ????
}
};

I create a duplicate of your library

I think I should tell you this, my company are just trying to find a library that can show notification form the status bar, after examine your code, I think maybe the best way to suit our need is to create a new library with Swift 2.0, the concept is rather same, but I think the architecture is a bit different, the repo is here https://github.com/36Kr-Mobile/StatusBarNotificationCenter, if there is something inappropriate, please let me know, thanks!

Disappears right away

I couldn't get it to stick. It appears and immediately disappears. Tested on iPhone5 & iOS7.
Tried on main thread
Tried with VC based status bar On/Off
Tried in AppDelegate as well as viewDidAppear of the first VC

How to disable rotation?

Is there a way to disable rotation? My app does not allow rotation. But if the screen rotates, only the notification view rotates.

Customization is not working

I have the following set up and none of the customisations are working :

self.statusBarNotification = [CWStatusBarNotification new];
    [self.statusBarNotification displayNotificationWithMessage:@"Fetching stations ..." completion:nil];
// The below lines don't seem to be working .. 
    self.statusBarNotification.notificationAnimationInStyle = CWNotificationAnimationStyleLeft;
    self.statusBarNotification.notificationLabelBackgroundColor = [UIColor clearColor];
    self.statusBarNotification.notificationLabelTextColor = [UIColor grayColor];

Possible to offset?

Hi,

To comply with Apple guidelines it would be nice to be able to show the notification bar for example under the navigation bar. Instagram and other apps do this.
Would it be possible to add an offset variable so that it's possible to manually set where the notification appears?

Thanks,
Michael

Feature: Add tap block

I'd love to be able to pass in a block that would be executed if the user taps on the notification.

Please let me know if you'd be open to a pull request for this.

Xcode beta 2 issue

Xcode 8 warns UIDeviceOrientation

implicit conversion from enumeration type 'UIInterfaceOrientation' (aka 'enum UIInterfaceOrientation') to different enumeration type 'UIDeviceOrientation'

UIDeviceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation)) {
        statusBarHeight = [[UIApplication sharedApplication] statusBarFrame].size.width;
}

Wrong width on iOS 9 with Split View and Slide Over

When the app is in a Slide Over or in Split View mode, the status bar notification is the wrong width, for example (slide over has the same issue):

simulator screen shot 19 sep 2015 11 43 00

(I blurred the app on the left as it hasn't been published on the App Store yet)

updateStatusBarFrame

i have had my own implementation of updateting the statusbarframe since ios8 is providing willtransitiontosize. its much simpler than lay on nsnotification center. had to disable all the observers for your pod to get it working. please consider a proper fix.
anyway, cool pod

Update notification midstream?

Is there any support for this and/or plan to support this? I'd like to use this library to show status for an upload operation.

NavigationBarStyle only top 20 pts invoke tap gesture

When showing a notification with the NavigationBarStyle only the top 20 pts (height of status bar style) of the frame invoke the tap gesture when tapping. When tapping on any other portion of the notification, the tap goes to the window underneath.

.M file have the category is implementing a method which will also be implemented by its primary class

Hey nice job for this class,

But when I try to implementing in my project in the CWStatusBarNotification.m I get this warring MSG "the category is implementing a method which will also be implemented by its primary class" in the

  • (BOOL)prefersStatusBarHidden;
    and
  • (UIStatusBarAnimation)preferredStatusBarUpdateAnimation

And I think that will be why my app is not showing this status bar!
iOS 7, which im using!

Build Failed With 19 Errors in iOS 8

I'm trying to implement CWStatusBarNotification into my app but receive 19 errors from within both the .h and .m files. Some of the errors include:

"Cannot find interface declaration for 'UILabel', superclass of 'ScrollLabel'"
"Unknown type name 'UIColor'"
"Class 'CWWindowContainer' defined without specifying a base class"

From what I can find on the web it seems it may a circular reference issue in one of the header files. I can't seem to figure it out though. Are there frameworks I haven't imported that it depends on?

I'm working in Xcode 6 for iOS 8 in an Objective-C project

Navigation Bar Color being changed

Hi,

I'm just trying out the notifications and noticed that it changes the color of the navigation bar. I have a black nav bar and before and after the animations, the notification changes it to white (or at least almost white).

I scanned though the docs but couldn't find anything related to that. Apologies if it's already been brought up.

Thanks.

Cover the status bar lead to rejection on App review

As the "Resolution Center" mentioned:

Apps must comply with all terms and conditions explained in the Apple iOS Human Interface Guidelines
We noticed your app does not comply with the Apple iOS Human Interface Guidelines.

Specifically, the app sends message that overlays the status bar. We've attached screenshot for your reference.

Adding a notice about that in the markdown may save times for other developers.

Notification offset when using view controller-based status bar appearance and navigation controller

I've run into an issue displaying notifications when view controller-based status bar appearance is enabled, showing a notification when a view controller is displayed and the status bar is hidden. This results in the navigation controller being temporarily pushed down when the notification is displayed.

I've resolved this by implementing prefersStatusBarHidden in CWViewController as follows..

- (BOOL)prefersStatusBarHidden
{
    CGFloat statusBarHeight = [[UIApplication sharedApplication] statusBarFrame].size.height;
    return !(statusBarHeight > 0);
}

This prevents the status bar from being temporarily displayed when CWViewController is added as the root view controller of the notification window and returns false in the default implementation of prefersStatusBarHidden.

Singleton?

Just wondering why this isn't a singleton (with Swift)? I know they are frowned upon most of the time. It just seems easier than to initiate a bunch of times

Incorrect screen grab scale on iPhone 6

I noticed strange behaviour on iPhone 6 where the CWStatusBarNotification, before displaying, grabs the screen image and displays it in the wrong scale (?). See for yourself, the flicker/jump seen before and after the notification gets shown / hidden in this screen recording.
notification

Xcode 8 beta 2 error

I get an error on latest pod, on line 111 CWStatusBarNotification.m (return _preferredStatusBarStyle) it says "undeclared identifier _preferredStatusBarStyle"

Feature: operation queue

Instead of immediately showing a notification, I should add one to a queue. This would provide better handling for multiple notifications received rapidly.

Please let me know if you'd be open to a pull request for this.

Memory Leak

My Crashlytics has picked up a leak in the code affects iOS 8 and crashes at CWStatusBarNotification.m > updateStatusBarFrame selector function.
Any chance you could assist on how to resolve this?

Fatal Exception: NSInvalidArgumentException
-[__NSCFString updateStatusBarFrame]: unrecognized selector sent to instance

Thread : Fatal Exception: NSInvalidArgumentException
0 CoreFoundation 0x256cafef exceptionPreprocess
1 libobjc.A.dylib 0x33d6ec8b objc_exception_throw
2 CoreFoundation 0x256d0409 __methodDescriptionForSelector
3 CoreFoundation 0x256ce327 __forwarding

4 CoreFoundation 0x255fde78 _CF_forwarding_prep_0
5 CoreFoundation 0x25682e09 CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER
6 CoreFoundation 0x255dd515 _CFXNotificationPost
7 Foundation 0x2633f749 -[NSNotificationCenter postNotificationName:object:userInfo:]
8 UIKit 0x28dcd18d -[UIApplication _notifyWillChangeStatusBarFrame:]
9 UIKit 0x28dccd8d -[UIApplication statusBar:willAnimateFromHeight:toHeight:duration:animation:]
10 UIKit 0x28db0d7f -[UIStatusBar _requestStyleAttributes:animationParameters:]
11 UIKit 0x28dafb93 -[UIStatusBar requestStyle:animated:]
12 CoreFoundation 0x25682e09 CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER
13 CoreFoundation 0x255dd515 _CFXNotificationPost
14 Foundation 0x2633f749 -[NSNotificationCenter postNotificationName:object:userInfo:]
15 Foundation 0x2634422f -[NSNotificationCenter postNotificationName:object:]
16 UIKit 0x28dc738f -[UIApplication _saveSnapshotWithName:]
17 UIKit 0x28faef77 -[UIApplication _handleApplicationDectivationWithScene:shouldForceExit:transitionContext:completion:]
18 UIKit 0x28fb62b1 __88-[UIApplication _handleApplicationLifecycleEventWithScene:transitionContext:completion:]_block_invoke
19 UIKit 0x28fb625d -[UIApplication _handleApplicationLifecycleEventWithScene:transitionContext:completion:]
20 UIKit 0x28fab11b -[UIApplication scene:didUpdateWithDiff:transitionContext:completion:]
21 FrontBoardServices 0x2c29aa65 __80-[FBSSceneImpl updater:didUpdateSettings:withDiff:transitionContext:completion:]_block_invoke_2
22 FrontBoardServices 0x2c2a9ec9 __31-[FBSSerialQueue performAsync:]_block_invoke_2
23 CoreFoundation 0x25690fd5 CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK
24 CoreFoundation 0x25690299 __CFRunLoopDoBlocks
25 CoreFoundation 0x2568edd3 __CFRunLoopRun
26 CoreFoundation 0x255db201 CFRunLoopRunSpecific
27 CoreFoundation 0x255db013 CFRunLoopRunInMode
28 GraphicsServices 0x2d0ac201 GSEventRunModal
29 UIKit 0x28da7a09 UIApplicationMain
30 Social Dummy 0x00025627 main (main.m:16)
31 libdyld.dylib 0x34320aaf start

Closing animation is very choppy

I implemented this library via cocoa pods and using the default settings for revealing and hiding the notification, the revealing animation is pretty smooth, however, the closing animation is very choppy ...

Please see the attached gif for reference ...

76jqn

label frame issue on changing Orientation.

The label frame takes always the portrait mode frame, even after changing Orientation.

  • (void)updateStatusBarFrame
    {
    UIView *view = self.isCustomView ? self.customView : self.notificationLabel;
    view.frame = [self getNotificationLabelFrame];
    self.statusBarView.hidden = YES;
    NSLog(@"frmae %@",NSStringFromCGRect(view.frame));
    }

Swift branch + CocoaPods doesn't work

Folder is empty when install Framework via CocoaPods.

I shouldn't copy *.swift files to use Framework, only pods (Because of project size and restrictions)

User interaction elsewhere is disabled while notification is displayed

Issue introduced in this commit: c8ba3fc

Because the status bar notification is in a new UIWindow, and the UIWindow controls the frame of its rootViewController, and userInteractionEnabled must be set to YES in order for subviews to be able to have a tap gesture recognizer, the transparent view of the rootViewController covers the screen and prevents interaction with the rest of the app aside from the notification.

Resizing the UIWindow seems to limit compatibility with screen rotation. I have also tried creating a custom UIView that overrides the (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event method to return NO on the view of the root view controller, but that seems to prevent interaction with the notification since the view of the root view controller overlaps with the frame of the notification.

dismissNotificationWithCompletion never completes

In public func dismissNotificationWithCompletion(completion : (() -> ())?) you return and the function never completes

               guard let view = self.isCustomView ? self.customView :
                    self.notificationLabel else {
                        return
                }

You need the completion before return

                guard let view = self.isCustomView ? self.customView :
                    self.notificationLabel else {
                        completion?()
                        return
                }

Problems displaying with double height status bar

I've just tried this out in an app I'm working on. When testing with double height status bar like when on a call, the notifications display much larger and jump around. Can this be fixed?

Thanks!

Text Scrolling Exceeding Width

When text is too long it scrolls to the end of the string. But then doesn't scroll back to the beginning if user missed the first part of the text. Would be great if this was added.

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.