Compare commits

...

1 Commits

Author SHA1 Message Date
Cezary Wojcik 15047c5264 1.0.1 2013-09-19 13:54:55 -07:00
2 changed files with 16 additions and 4 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "CWStatusBarNotification"
s.version = "1.0.0"
s.version = "1.0.1"
s.summary = "A category on UIViewController to show a text notification in the status bar."
s.description = "CWStatusBarNotification adds a category on UIViewController that allows you to present a text-based notification in the status bar."
s.homepage = "http://github.com/cezarywojcik/CWStatusBarNotification"
@@ -19,7 +19,7 @@ NSString const *CWStatusBarIsHiddenKey = @"CWStatusBarIsHiddenKey";
NSString const *CWStatusBarNotificationIsShowingKey = @"CWStatusBarNotificationIsShowingKey";
NSString const *CWStatusBarNotificationLabelKey = @"CWStatusBarNotificationLabelKey";
# pragma mark - helper functions
# pragma mark - overriding functions
// The below functions produce warnings - not an issue
- (BOOL)prefersStatusBarHidden {
@@ -30,6 +30,18 @@ NSString const *CWStatusBarNotificationLabelKey = @"CWStatusBarNotificationLabel
return UIStatusBarAnimationSlide;
}
# pragma mark - helper functions
- (void)updateStatusBar {
if ([self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)]) {
// iOS 7
[self setNeedsStatusBarAppearanceUpdate];
} else {
// iOS 6
[[UIApplication sharedApplication] setStatusBarHidden:self.statusBarIsHidden withAnimation:self.preferredStatusBarUpdateAnimation];
}
}
# pragma mark - dimensions
- (CGFloat)getStatusBarWidth {
@@ -61,7 +73,7 @@ NSString const *CWStatusBarNotificationLabelKey = @"CWStatusBarNotificationLabel
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(screenOrientationChanged) name:UIApplicationDidChangeStatusBarOrientationNotification object:nil];
[UIView animateWithDuration:STATUS_BAR_ANIMATION_LENGTH animations:^{
self.statusBarIsHidden = YES;
[self setNeedsStatusBarAppearanceUpdate];
[self updateStatusBar];
self.statusBarNotificationLabel.frame = [self getStatusBarFrame];
} completion:^(BOOL finished) {
[UIView animateWithDuration:duration - 2*STATUS_BAR_ANIMATION_LENGTH animations:^{
@@ -71,7 +83,7 @@ NSString const *CWStatusBarNotificationLabelKey = @"CWStatusBarNotificationLabel
dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
[UIView animateWithDuration:STATUS_BAR_ANIMATION_LENGTH animations:^{
self.statusBarIsHidden = NO;
[self setNeedsStatusBarAppearanceUpdate];
[self updateStatusBar];
self.statusBarNotificationLabel.frame = [self getStatusBarHiddenFrame];
} completion:^(BOOL finished) {
[self.statusBarNotificationLabel removeFromSuperview];