Comments (8)
I can't quite see what's going on with that gif, as the gif itself seems somewhat choppy, but do you experience the same issue with the demo app? If not, the first thing I might try is handling the notification on the main queue in your app.
from cwstatusbarnotification.
This is my set up :
self.statusBarNotification = [CWStatusBarNotification new];
self.statusBarNotification.notificationLabelBackgroundColor = [UIColor colorWithRed:212.0/255.0 green:212.0/255.0 blue:212.0/255.0 alpha:1.0];
self.statusBarNotification.notificationLabelTextColor = [UIColor blackColor];
[self.statusBarNotification displayNotificationWithMessage:@"Fetching stations ..." completion:nil];
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
[manager GET:@"http://rpi.athwani.net:8843/stations" parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {
self.stationsDisctionary = (NSDictionary *)responseObject;
[[NSNotificationCenter defaultCenter] postNotificationName:gotStations object:nil userInfo:nil];
dispatch_async(dispatch_get_main_queue(), ^{
[self.statusBarNotification dismissNotification];
});
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"Error: %@", error);
}];
I've uploaded a video of the problem here :
https://mega.co.nz/#!BUEHEIRA!LXZ4aDk21f32uW7yWf2jkwuMks2NpE8CygTT6c9FQ_M
The sample project seems to be working fine ....
from cwstatusbarnotification.
This probably isn't your issue, but AFNetworking success blocks are guaranteed to be called on the main thread, so the dispatch to the main queue is unnecessary.
from cwstatusbarnotification.
Moved the dismiss call outside the dispatch to main queue, and still no luck. The closing animation is still choppy :(
from cwstatusbarnotification.
Is the other stuff before the AFNetworking call on the main thread too?
from cwstatusbarnotification.
It's actually in a singleton which handles all the downloads. The singleton is called from the main thread for sure.
from cwstatusbarnotification.
Sorry that I haven't gotten around to this; I've been busy with school.
Anyhow, I tried to recreate your situation like this:
self.notification = [CWStatusBarNotification new];
self.notification.notificationLabelBackgroundColor = [UIColor colorWithRed:212.0/255.0 green:212.0/255.0 blue:212.0/255.0 alpha:1.0];
self.notification.notificationLabelTextColor = [UIColor blackColor];
[self.notification displayNotificationWithMessage:@"Fetching stations ..." completion:nil];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self.notification dismissNotification];
});
However, everything looked fine on my end.
Based on the video you provided, I made a better quality gif.
Here are the exploded frames for the closing:
http://gif-explode.com/?explode=https://www.filepicker.io/api/file/hubwlNIRLmRPPYjx4VkS
It looks like there is another black bar that is covering up the notification as it is being dismissed.
I took another look at the starting animation:
http://gif-explode.com/?explode=https://www.filepicker.io/api/file/sPQ1rT6iSKuo2wI9IMvg
It looks like there is also an issue with the start, as at the beginning, the status bar area is black and the status bar is fading back in. The way the library works is by taking a screenshot of the status bar before displaying the notification, so if this area is black or in some other state of transition before the notification is displayed, this will obviously cause issues.
Are you doing anything else with the status bar before displaying the notification? That would explain why you were having this issue.
from cwstatusbarnotification.
I figured out the issue .... I was indirectly calling this from the app delegate ... hence the choppy animation ...
from cwstatusbarnotification.
Related Issues (20)
- Property "preferredStatusBarStyle" of "UIViewController" has become readonly, leading to crash. HOT 6
- Error : Module file was created by an older version of the compiler; rebuild 'CWStatusBarNotification' and try again: /Users/leela/FASME NATIVE NEW/FASME_NATIVE_NEW/mobile_development/ios_development/FASME_New/fasme_native_development parse/CWStatusBarNotification.framework/Modules/CWStatusBarNotification.swiftmodule/arm.swiftmodule
- Set custom notification height HOT 1
- Extreme CPU usage
- Any thoughts on switching to the "home indicator" area for iPhone X? (screenshot) HOT 48
- iPhone X and Swift 4 support ? HOT 1
- iPhone X navigation bar style with text not centered HOT 6
- Swipe to dismiss
- iOS13 状态栏系统时间把notificationLabel遮挡
- Component not drawing over status bar anymore on iOS 13 HOT 7
- Component not working with UIScene
- Navigation Bar Color being changed HOT 2
- How to push the specified controller ?
- Xcode 8 beta 2 error HOT 10
- Xcode beta 2 issue
- Update latest code on cocoapods HOT 2
- Can you add a new api like this?
- Use of undeclared identifier '_preferredStatusBarStyle' HOT 1
- iOS 10 : XCode 8 : preferredStatusBarStyle HOT 1
- Support Swift 3.0? HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cwstatusbarnotification.