├── picture1.jpg ├── picture2.jpg ├── picture3.jpg ├── picture4.jpg ├── BWStatusBarOverlayExample ├── en.lproj │ └── InfoPlist.strings ├── FirstViewController.h ├── AppDelegate.h ├── BWStatusBarOverlayExample-Prefix.pch ├── main.m ├── BWStatusBarOverlayExample-Info.plist ├── AppDelegate.m ├── FirstViewController.m └── FirstViewController.xib ├── BWStatusBarOverlayExampleTests ├── en.lproj │ └── InfoPlist.strings ├── BWStatusBarOverlayExampleTests.h ├── BWStatusBarOverlayExampleTests.m └── BWStatusBarOverlayExampleTests-Info.plist ├── BWStatusBarOverlay ├── status-bar-progress.png ├── status-bar-progress@2x.png ├── status-bar-pattern-black.jpg ├── status-bar-pattern-black@2x.jpg ├── status-bar-pattern-default.jpg ├── status-bar-pattern-default@2x.jpg ├── BWStatusBarOverlay.h └── BWStatusBarOverlay.m ├── .gitignore ├── README.md ├── LICENSE └── BWStatusBarOverlayExample.xcodeproj └── project.pbxproj /picture1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ml-archive/BWStatusBarOverlay/master/picture1.jpg -------------------------------------------------------------------------------- /picture2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ml-archive/BWStatusBarOverlay/master/picture2.jpg -------------------------------------------------------------------------------- /picture3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ml-archive/BWStatusBarOverlay/master/picture3.jpg -------------------------------------------------------------------------------- /picture4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ml-archive/BWStatusBarOverlay/master/picture4.jpg -------------------------------------------------------------------------------- /BWStatusBarOverlayExample/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /BWStatusBarOverlayExampleTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /BWStatusBarOverlay/status-bar-progress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ml-archive/BWStatusBarOverlay/master/BWStatusBarOverlay/status-bar-progress.png -------------------------------------------------------------------------------- /BWStatusBarOverlay/status-bar-progress@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ml-archive/BWStatusBarOverlay/master/BWStatusBarOverlay/status-bar-progress@2x.png -------------------------------------------------------------------------------- /BWStatusBarOverlay/status-bar-pattern-black.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ml-archive/BWStatusBarOverlay/master/BWStatusBarOverlay/status-bar-pattern-black.jpg -------------------------------------------------------------------------------- /BWStatusBarOverlay/status-bar-pattern-black@2x.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ml-archive/BWStatusBarOverlay/master/BWStatusBarOverlay/status-bar-pattern-black@2x.jpg -------------------------------------------------------------------------------- /BWStatusBarOverlay/status-bar-pattern-default.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ml-archive/BWStatusBarOverlay/master/BWStatusBarOverlay/status-bar-pattern-default.jpg -------------------------------------------------------------------------------- /BWStatusBarOverlay/status-bar-pattern-default@2x.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ml-archive/BWStatusBarOverlay/master/BWStatusBarOverlay/status-bar-pattern-default@2x.jpg -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | build/* 3 | *.pbxuser 4 | !default.pbxuser 5 | *.mode1v3 6 | !default.mode1v3 7 | *.mode2v3 8 | !default.mode2v3 9 | *.perspectivev3 10 | !default.perspectivev3 11 | *.xcworkspace 12 | !default.xcworkspace 13 | xcuserdata 14 | profile 15 | *.moved-aside 16 | -------------------------------------------------------------------------------- /BWStatusBarOverlayExample/FirstViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // FirstViewController.h 3 | // BWStatusBarProgressOverlayExample 4 | // 5 | // Created by Bruno Wernimont on 3/07/12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface FirstViewController : UIViewController { 12 | 13 | } 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /BWStatusBarOverlayExample/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // BWStatusBarOverlayExample 4 | // 5 | // Created by Bruno Wernimont on 4/07/12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /BWStatusBarOverlayExampleTests/BWStatusBarOverlayExampleTests.h: -------------------------------------------------------------------------------- 1 | // 2 | // BWStatusBarOverlayExampleTests.h 3 | // BWStatusBarOverlayExampleTests 4 | // 5 | // Created by Bruno Wernimont on 4/07/12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BWStatusBarOverlayExampleTests : SenTestCase 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /BWStatusBarOverlayExample/BWStatusBarOverlayExample-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'BWStatusBarOverlayExample' target in the 'BWStatusBarOverlayExample' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iOS SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /BWStatusBarOverlayExample/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // BWStatusBarOverlayExample 4 | // 5 | // Created by Bruno Wernimont on 4/07/12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AppDelegate.h" 12 | 13 | int main(int argc, char *argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /BWStatusBarOverlayExampleTests/BWStatusBarOverlayExampleTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // BWStatusBarOverlayExampleTests.m 3 | // BWStatusBarOverlayExampleTests 4 | // 5 | // Created by Bruno Wernimont on 4/07/12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "BWStatusBarOverlayExampleTests.h" 10 | 11 | @implementation BWStatusBarOverlayExampleTests 12 | 13 | - (void)setUp 14 | { 15 | [super setUp]; 16 | 17 | // Set-up code here. 18 | } 19 | 20 | - (void)tearDown 21 | { 22 | // Tear-down code here. 23 | 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample 28 | { 29 | STFail(@"Unit tests are not implemented yet in BWStatusBarOverlayExampleTests"); 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /BWStatusBarOverlayExampleTests/BWStatusBarOverlayExampleTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | brunowernimont.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /BWStatusBarOverlayExample/BWStatusBarOverlayExample-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | brunowernimont.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## BWStatusBarOverlay 2 | 3 | BWStatusBarOverlay is a custom status bar overlay window. It support touch by setting a block that will be called after touch. It work well on both iPad and iPhone and of course in any orientation. 4 | 5 | ![Screenshot](https://github.com/brunow/BWStatusBarOverlay/raw/master/picture1.jpg) 6 | 7 | ![Screenshot](https://github.com/brunow/BWStatusBarOverlay/raw/master/picture2.jpg) 8 | 9 | ![Screenshot](https://github.com/brunow/BWStatusBarOverlay/raw/master/picture3.jpg) 10 | 11 | ![Screenshot](https://github.com/brunow/BWStatusBarOverlay/raw/master/picture4.jpg) 12 | 13 | ## Installation 14 | 15 | **Copy** **BWStatusBarOverlay** dir into your project. 16 | 17 | ## How to use it 18 | 19 | + (id)shared; 20 | 21 | Show overlay 22 | 23 | + (void)showWithMessage:(NSString *)message loading:(BOOL)loading animated:(BOOL)animated; 24 | + (void)showWithMessage:(NSString *)message animated:(BOOL)animated; 25 | + (void)showLoadingWithMessage:(NSString *)message animated:(BOOL)animated; 26 | 27 | Show message and hide after duration 28 | 29 | + (void)showSuccessWithMessage:(NSString *)message duration:(NSTimeInterval)duration animated:(BOOL)animated; 30 | + (void)showErrorWithMessage:(NSString *)message duration:(NSTimeInterval)duration animated:(BOOL)animated; 31 | 32 | Customizing 33 | 34 | + (void)setProgress:(float)progress animated:(BOOL)animated; 35 | + (void)showActivity:(BOOL)show animated:(BOOL)animated; 36 | + (void)setBackgroundColor:(UIColor *)backgroundColor; 37 | + (void)setStatusBarStyle:(UIStatusBarStyle)statusBarStyle animated:(BOOL)animated; 38 | + (void)setAnimation:(BWStatusBarOverlayAnimationType)animation; 39 | + (void)setActionBlock:(BWStatusBarBasicBlock)actionBlock; 40 | + (void)setProgressBackgroundColor:(UIColor *)backgroundColor; 41 | 42 | Hidding 43 | 44 | + (void)dismissAnimated:(BOOL)animated; 45 | + (void)dismissAnimated; 46 | + (void)dismiss; 47 | 48 | Animation type 49 | 50 | typedef enum { 51 | BWStatusBarOverlayAnimationTypeNone, /* No animation */ 52 | BWStatusBarOverlayAnimationTypeFromTop, /* Element appear from top */ 53 | BWStatusBarOverlayAnimationTypeFade /* Element appear with alpha transition */ 54 | } BWStatusBarOverlayAnimationType; 55 | 56 | ## ARC 57 | 58 | BWStatusBarOverlay is ARC only. 59 | 60 | ## Contact 61 | 62 | Bruno Wernimont 63 | 64 | - Twitter - [@brunowernimont](http://twitter.com/brunowernimont) 65 | 66 | ## Thanks 67 | 68 | Thanks to [Noomia](http://noomiastudio.com/) for the blue gradient image. -------------------------------------------------------------------------------- /BWStatusBarOverlayExample/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // BWStatusBarOverlayExample 4 | // 5 | // Created by Bruno Wernimont on 4/07/12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | #import "FirstViewController.h" 12 | 13 | @implementation AppDelegate 14 | 15 | @synthesize window = _window; 16 | 17 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 18 | { 19 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 20 | // Override point for customization after application launch. 21 | self.window.rootViewController = [[FirstViewController alloc] init]; 22 | self.window.backgroundColor = [UIColor whiteColor]; 23 | [self.window makeKeyAndVisible]; 24 | return YES; 25 | } 26 | 27 | - (void)applicationWillResignActive:(UIApplication *)application 28 | { 29 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 30 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 31 | } 32 | 33 | - (void)applicationDidEnterBackground:(UIApplication *)application 34 | { 35 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 36 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 37 | } 38 | 39 | - (void)applicationWillEnterForeground:(UIApplication *)application 40 | { 41 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 42 | } 43 | 44 | - (void)applicationDidBecomeActive:(UIApplication *)application 45 | { 46 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 47 | } 48 | 49 | - (void)applicationWillTerminate:(UIApplication *)application 50 | { 51 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 52 | } 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /BWStatusBarOverlayExample/FirstViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // FirstViewController.m 3 | // BWStatusBarOverlayExample 4 | // 5 | // Created by Bruno Wernimont on 3/07/12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "FirstViewController.h" 10 | 11 | #import "BWStatusBarOverlay.h" 12 | #include 13 | 14 | @interface FirstViewController () 15 | 16 | @end 17 | 18 | @implementation FirstViewController 19 | 20 | 21 | //////////////////////////////////////////////////////////////////////////////////////////////////// 22 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 23 | return YES; 24 | } 25 | 26 | 27 | //////////////////////////////////////////////////////////////////////////////////////////////////// 28 | - (NSString *)randomMessage { 29 | int r = rand() % 74; 30 | return @"Download files 1 of 2"; 31 | return [NSString stringWithFormat:@"Random number %d", r]; 32 | } 33 | 34 | 35 | //////////////////////////////////////////////////////////////////////////////////////////////////// 36 | - (void)viewDidLoad { 37 | [super viewDidLoad]; 38 | 39 | [BWStatusBarOverlay setActionBlock:^{ 40 | NSLog(@"you pressed me"); 41 | }]; 42 | } 43 | 44 | 45 | //////////////////////////////////////////////////////////////////////////////////////////////////// 46 | //////////////////////////////////////////////////////////////////////////////////////////////////// 47 | #pragma mark - 48 | #pragma mark Actions 49 | 50 | 51 | //////////////////////////////////////////////////////////////////////////////////////////////////// 52 | - (IBAction)didPressChangeStatusBarStyle:(id)sender { 53 | UIStatusBarStyle statusBarStyle = [UIApplication sharedApplication].statusBarStyle; 54 | 55 | if (UIStatusBarStyleDefault == statusBarStyle) { 56 | [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackOpaque animated:YES]; 57 | [BWStatusBarOverlay setStatusBarStyle:UIStatusBarStyleBlackOpaque animated:YES]; 58 | } else { 59 | [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault animated:YES]; 60 | [BWStatusBarOverlay setStatusBarStyle:UIStatusBarStyleDefault animated:YES]; 61 | } 62 | } 63 | 64 | 65 | //////////////////////////////////////////////////////////////////////////////////////////////////// 66 | - (IBAction)didPressChangeProgression:(id)sender { 67 | [BWStatusBarOverlay setProgress:0.7 animated:YES]; 68 | } 69 | 70 | 71 | //////////////////////////////////////////////////////////////////////////////////////////////////// 72 | - (IBAction)didPressShowSimple:(id)sender { 73 | [BWStatusBarOverlay showWithMessage:[self randomMessage] loading:YES animated:NO]; 74 | } 75 | 76 | 77 | //////////////////////////////////////////////////////////////////////////////////////////////////// 78 | - (IBAction)didPressShowWithFade:(id)sender { 79 | [BWStatusBarOverlay setAnimation:BWStatusBarOverlayAnimationTypeFade]; 80 | [BWStatusBarOverlay showWithMessage:[self randomMessage] loading:YES animated:YES]; 81 | } 82 | 83 | 84 | //////////////////////////////////////////////////////////////////////////////////////////////////// 85 | - (IBAction)didPressShowWithFromTop:(id)sender { 86 | [BWStatusBarOverlay setAnimation:BWStatusBarOverlayAnimationTypeFromTop]; 87 | [BWStatusBarOverlay showWithMessage:[self randomMessage] loading:YES animated:YES]; 88 | } 89 | 90 | 91 | //////////////////////////////////////////////////////////////////////////////////////////////////// 92 | - (IBAction)didPressHideSimple:(id)sender { 93 | [BWStatusBarOverlay dismissAnimated:YES]; 94 | } 95 | 96 | 97 | //////////////////////////////////////////////////////////////////////////////////////////////////// 98 | - (IBAction)didPressChangeAnimatedText:(id)sender { 99 | [BWStatusBarOverlay setMessage:[self randomMessage] animated:YES]; 100 | } 101 | 102 | 103 | //////////////////////////////////////////////////////////////////////////////////////////////////// 104 | - (IBAction)didPressShowSuccess:(id)sender { 105 | [BWStatusBarOverlay showSuccessWithMessage:@"Success" duration:2 animated:YES]; 106 | } 107 | 108 | 109 | //////////////////////////////////////////////////////////////////////////////////////////////////// 110 | - (IBAction)didPressShowError:(id)sender { 111 | [BWStatusBarOverlay showErrorWithMessage:@"Error" duration:2 animated:YES]; 112 | } 113 | 114 | 115 | //////////////////////////////////////////////////////////////////////////////////////////////////// 116 | - (IBAction)didPressChangeText:(id)sender { 117 | [BWStatusBarOverlay setMessage:[self randomMessage] animated:NO]; 118 | } 119 | 120 | 121 | @end 122 | -------------------------------------------------------------------------------- /BWStatusBarOverlay/BWStatusBarOverlay.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Bruno Wernimont on 2012 3 | // Copyright 2012 BWLongTextViewController 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | 18 | #import 19 | 20 | @class BWStatusBarOverlay; 21 | 22 | typedef void (^BWStatusBarBasicBlock)(void); 23 | 24 | typedef enum { 25 | BWStatusBarOverlayAnimationTypeNone, /* No animation */ 26 | BWStatusBarOverlayAnimationTypeFromTop, /* Element appear from top */ 27 | BWStatusBarOverlayAnimationTypeFade /* Element appear with alpha transition */ 28 | } BWStatusBarOverlayAnimationType; 29 | 30 | typedef enum { 31 | BWStatusBarOverlayStatusSuccess, /* Show success overlay */ 32 | BWStatusBarOverlayStatusError /* Show error overlay */ 33 | } BWStatusBarOverlayStatus; 34 | 35 | @interface BWStatusBarOverlay : UIWindow { 36 | UIView *_progressView; 37 | } 38 | 39 | @property (nonatomic, assign) float progress; 40 | 41 | @property (nonatomic, readonly) UIView *contentView; 42 | 43 | /** 44 | TextLabel readonly property 45 | */ 46 | @property (nonatomic, readonly) UILabel *textLabel; 47 | 48 | /** 49 | StatusLabel used to show status 50 | Not implemented yet 51 | */ 52 | @property (nonatomic, readonly) UILabel *statusLabel; 53 | 54 | /** 55 | Activity view readonly property 56 | */ 57 | @property (nonatomic, readonly) UIActivityIndicatorView *activityView; 58 | 59 | /** 60 | Animation type from overlay 61 | */ 62 | @property (nonatomic, assign) BWStatusBarOverlayAnimationType animation; 63 | 64 | /** 65 | Background color from progress view 66 | */ 67 | @property (nonatomic, assign) UIColor *progressBackgroundColor; 68 | 69 | /** 70 | Block that will be execute if user press the overlay 71 | */ 72 | @property (nonatomic, copy) BWStatusBarBasicBlock actionBlock; 73 | 74 | /** 75 | Return a shared instance of BWStatusBarOverlay class 76 | 77 | @return Return a shared instance of BWStatusBarOverlay class 78 | */ 79 | + (BWStatusBarOverlay *)shared; 80 | 81 | /** 82 | Show the overlay on the status bar with a message 83 | 84 | @param message Message that will appear on the label 85 | @param loading Show an activity view 86 | @param animated Show with an animation 87 | */ 88 | - (void)showWithMessage:(NSString *)message loading:(BOOL)loading animated:(BOOL)animated; 89 | 90 | /** 91 | Show the overlay on the status bar with a message 92 | 93 | @param message Message that will appear on the label 94 | @param animated Show with an animation 95 | */ 96 | - (void)showWithMessage:(NSString *)message animated:(BOOL)animated; 97 | 98 | /** 99 | Show the overlay on the status bar with a message and activity view 100 | 101 | @param message Message that will appear on the label 102 | @param animated Show with an animation 103 | */ 104 | - (void)showLoadingWithMessage:(NSString *)message animated:(BOOL)animated; 105 | 106 | /** 107 | Change the text message 108 | 109 | @param message Message that will appear on the label 110 | @param animated Show the message with an animation 111 | */ 112 | - (void)setMessage:(NSString *)message animated:(BOOL)animated; 113 | 114 | /** 115 | Show message with a success icon 116 | 117 | @param message Message that will appear on the label 118 | @param duration Time in second after the message will be hidden 119 | @param animated Show the message with an animation 120 | */ 121 | - (void)showSuccessWithMessage:(NSString *)message duration:(NSTimeInterval)duration animated:(BOOL)animated; 122 | 123 | /** 124 | Show message with a error icon 125 | 126 | @param message Message that will appear on the label 127 | @param duration Time in second after the message will be hidden 128 | @param animated Show the message with an animation 129 | */ 130 | - (void)showErrorWithMessage:(NSString *)message duration:(NSTimeInterval)duration animated:(BOOL)animated; 131 | 132 | /** 133 | Hide the overlay from status bar 134 | 135 | @param animated Hide with an animation 136 | */ 137 | - (void)dismissAnimated:(BOOL)animated; 138 | 139 | /** 140 | Hide the overlay from status bar with an animation 141 | */ 142 | - (void)dismissAnimated; 143 | 144 | /** 145 | Hide the overlay from status bar without animation 146 | */ 147 | - (void)dismiss; 148 | 149 | /** 150 | Change the progress value 151 | 152 | @param progress Progression value between 1 and 0 153 | @param animated Change value with animation 154 | */ 155 | - (void)setProgress:(float)progress animated:(BOOL)animated; 156 | 157 | /** 158 | Show the activity view 159 | 160 | @param show Show or hide activity 161 | @param animated Show or hide with an animation 162 | */ 163 | - (void)showActivity:(BOOL)show animated:(BOOL)animated; 164 | 165 | /** 166 | Change the background color from overlay 167 | 168 | @param backgroundColor Background color from overlay 169 | */ 170 | - (void)setBackgroundColor:(UIColor *)backgroundColor; 171 | 172 | /** 173 | Change overlay style 174 | 175 | @param statusBarStyle @see UIStatusBarStyle 176 | @param animated Animate status bar style change 177 | */ 178 | - (void)setStatusBarStyle:(UIStatusBarStyle)statusBarStyle animated:(BOOL)animated; 179 | 180 | /* Class methods */ 181 | 182 | + (void)showWithMessage:(NSString *)message loading:(BOOL)loading animated:(BOOL)animated; 183 | 184 | + (void)showWithMessage:(NSString *)message animated:(BOOL)animated; 185 | 186 | + (void)showLoadingWithMessage:(NSString *)message animated:(BOOL)animated; 187 | 188 | + (void)setMessage:(NSString *)message animated:(BOOL)animated; 189 | 190 | + (void)showSuccessWithMessage:(NSString *)message duration:(NSTimeInterval)duration animated:(BOOL)animated; 191 | 192 | + (void)showErrorWithMessage:(NSString *)message duration:(NSTimeInterval)duration animated:(BOOL)animated; 193 | 194 | + (void)dismissAnimated:(BOOL)animated; 195 | 196 | + (void)dismissAnimated; 197 | 198 | + (void)dismiss; 199 | 200 | + (void)setAnimation:(BWStatusBarOverlayAnimationType)animation; 201 | 202 | + (void)setProgress:(float)progress animated:(BOOL)animated; 203 | 204 | + (void)showActivity:(BOOL)show animated:(BOOL)animated; 205 | 206 | + (void)setBackgroundColor:(UIColor *)backgroundColor; 207 | 208 | + (void)setStatusBarStyle:(UIStatusBarStyle)statusBarStyle animated:(BOOL)animated; 209 | 210 | + (void)setActionBlock:(BWStatusBarBasicBlock)actionBlock; 211 | 212 | + (void)setProgressBackgroundColor:(UIColor *)backgroundColor; 213 | 214 | @end 215 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. -------------------------------------------------------------------------------- /BWStatusBarOverlayExample/FirstViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1296 5 | 11E53 6 | 2182 7 | 1138.47 8 | 569.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 1181 12 | 13 | 14 | IBProxyObject 15 | IBUIView 16 | IBUIButton 17 | 18 | 19 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 20 | 21 | 22 | PluginDependencyRecalculationVersion 23 | 24 | 25 | 26 | 27 | IBFilesOwner 28 | IBCocoaTouchFramework 29 | 30 | 31 | IBFirstResponder 32 | IBCocoaTouchFramework 33 | 34 | 35 | 36 | 274 37 | 38 | 39 | 40 | 292 41 | {{57, 17}, {182, 37}} 42 | 43 | 44 | 45 | _NS:9 46 | NO 47 | IBCocoaTouchFramework 48 | 0 49 | 0 50 | 1 51 | Show simple 52 | 53 | 3 54 | MQA 55 | 56 | 57 | 1 58 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 59 | 60 | 61 | 3 62 | MC41AA 63 | 64 | 65 | 2 66 | 15 67 | 68 | 69 | Helvetica-Bold 70 | 15 71 | 16 72 | 73 | 74 | 75 | 76 | 292 77 | {{57, 361}, {182, 37}} 78 | 79 | 80 | 81 | _NS:9 82 | NO 83 | IBCocoaTouchFramework 84 | 0 85 | 0 86 | 1 87 | Hide 88 | 89 | 90 | 1 91 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 292 100 | {{51, 406}, {194, 37}} 101 | 102 | 103 | _NS:9 104 | NO 105 | IBCocoaTouchFramework 106 | 0 107 | 0 108 | 1 109 | Change status bar style 110 | 111 | 112 | 1 113 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 292 122 | {{57, 159}, {182, 37}} 123 | 124 | 125 | 126 | _NS:9 127 | NO 128 | IBCocoaTouchFramework 129 | 0 130 | 0 131 | 1 132 | Change animated text 133 | 134 | 135 | 1 136 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 292 145 | {{57, 211}, {182, 37}} 146 | 147 | 148 | 149 | _NS:9 150 | NO 151 | IBCocoaTouchFramework 152 | 0 153 | 0 154 | 1 155 | Progression 156 | 157 | 158 | 1 159 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 292 168 | {{57, 262}, {182, 37}} 169 | 170 | 171 | 172 | _NS:9 173 | NO 174 | IBCocoaTouchFramework 175 | 0 176 | 0 177 | 1 178 | show success 179 | 180 | 181 | 1 182 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 292 191 | {{57, 314}, {182, 37}} 192 | 193 | 194 | 195 | _NS:9 196 | NO 197 | IBCocoaTouchFramework 198 | 0 199 | 0 200 | 1 201 | show failure 202 | 203 | 204 | 1 205 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 292 214 | {{57, 64}, {182, 37}} 215 | 216 | 217 | 218 | _NS:9 219 | NO 220 | IBCocoaTouchFramework 221 | 0 222 | 0 223 | 1 224 | Show with fade 225 | 226 | 227 | 1 228 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 292 237 | {{57, 111}, {182, 37}} 238 | 239 | 240 | 241 | _NS:9 242 | NO 243 | IBCocoaTouchFramework 244 | 0 245 | 0 246 | 1 247 | Show from top 248 | 249 | 250 | 1 251 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 252 | 253 | 254 | 255 | 256 | 257 | 258 | {{0, 20}, {320, 460}} 259 | 260 | 261 | 262 | 263 | 3 264 | MQA 265 | 266 | 2 267 | 268 | 269 | 270 | IBCocoaTouchFramework 271 | 272 | 273 | 274 | 275 | 276 | 277 | view 278 | 279 | 280 | 281 | 3 282 | 283 | 284 | 285 | didPressShowSimple: 286 | 287 | 288 | 7 289 | 290 | 5 291 | 292 | 293 | 294 | didPressHideSimple: 295 | 296 | 297 | 7 298 | 299 | 9 300 | 301 | 302 | 303 | didPressChangeAnimatedText: 304 | 305 | 306 | 7 307 | 308 | 12 309 | 310 | 311 | 312 | didPressChangeProgression: 313 | 314 | 315 | 7 316 | 317 | 15 318 | 319 | 320 | 321 | didPressShowWithFade: 322 | 323 | 324 | 7 325 | 326 | 19 327 | 328 | 329 | 330 | didPressShowWithFromTop: 331 | 332 | 333 | 7 334 | 335 | 29 336 | 337 | 338 | 339 | didPressShowSuccess: 340 | 341 | 342 | 7 343 | 344 | 25 345 | 346 | 347 | 348 | didPressShowError: 349 | 350 | 351 | 7 352 | 353 | 24 354 | 355 | 356 | 357 | didPressChangeStatusBarStyle: 358 | 359 | 360 | 7 361 | 362 | 32 363 | 364 | 365 | 366 | 367 | 368 | 0 369 | 370 | 371 | 372 | 373 | 374 | 1 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | -1 391 | 392 | 393 | File's Owner 394 | 395 | 396 | -2 397 | 398 | 399 | 400 | 401 | 4 402 | 403 | 404 | 405 | 406 | 6 407 | 408 | 409 | 410 | 411 | 10 412 | 413 | 414 | 415 | 416 | 14 417 | 418 | 419 | 420 | 421 | 16 422 | 423 | 424 | 425 | 426 | 17 427 | 428 | 429 | 430 | 431 | 20 432 | 433 | 434 | 435 | 436 | 22 437 | 438 | 439 | 440 | 441 | 30 442 | 443 | 444 | 445 | 446 | 447 | 448 | FirstViewController 449 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 450 | UIResponder 451 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 452 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 453 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 454 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 455 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 456 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 457 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 458 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 459 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 460 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 461 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 462 | 463 | 464 | 465 | 466 | 467 | 32 468 | 469 | 470 | 471 | 472 | FirstViewController 473 | UIViewController 474 | 475 | IBProjectSource 476 | ./Classes/FirstViewController.h 477 | 478 | 479 | 480 | 481 | 0 482 | IBCocoaTouchFramework 483 | 484 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 485 | 486 | 487 | YES 488 | 3 489 | 1181 490 | 491 | 492 | -------------------------------------------------------------------------------- /BWStatusBarOverlayExample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | E70C8F9615A42FF9008C0CB6 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E70C8F9515A42FF9008C0CB6 /* UIKit.framework */; }; 11 | E70C8F9815A42FF9008C0CB6 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E70C8F9715A42FF9008C0CB6 /* Foundation.framework */; }; 12 | E70C8F9A15A42FF9008C0CB6 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E70C8F9915A42FF9008C0CB6 /* CoreGraphics.framework */; }; 13 | E70C8FA015A42FF9008C0CB6 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = E70C8F9E15A42FF9008C0CB6 /* InfoPlist.strings */; }; 14 | E70C8FA215A42FF9008C0CB6 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = E70C8FA115A42FF9008C0CB6 /* main.m */; }; 15 | E70C8FA615A42FF9008C0CB6 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = E70C8FA515A42FF9008C0CB6 /* AppDelegate.m */; }; 16 | E70C8FAE15A42FF9008C0CB6 /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E70C8FAD15A42FF9008C0CB6 /* SenTestingKit.framework */; }; 17 | E70C8FAF15A42FF9008C0CB6 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E70C8F9515A42FF9008C0CB6 /* UIKit.framework */; }; 18 | E70C8FB015A42FF9008C0CB6 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E70C8F9715A42FF9008C0CB6 /* Foundation.framework */; }; 19 | E70C8FB815A42FF9008C0CB6 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = E70C8FB615A42FF9008C0CB6 /* InfoPlist.strings */; }; 20 | E70C8FBB15A42FF9008C0CB6 /* BWStatusBarOverlayExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E70C8FBA15A42FF9008C0CB6 /* BWStatusBarOverlayExampleTests.m */; }; 21 | E70C8FCB15A43013008C0CB6 /* BWStatusBarOverlay.m in Sources */ = {isa = PBXBuildFile; fileRef = E70C8FC615A43013008C0CB6 /* BWStatusBarOverlay.m */; }; 22 | E70C8FCC15A43013008C0CB6 /* status-bar-pattern-black.jpg in Resources */ = {isa = PBXBuildFile; fileRef = E70C8FC715A43013008C0CB6 /* status-bar-pattern-black.jpg */; }; 23 | E70C8FCD15A43013008C0CB6 /* status-bar-pattern-black@2x.jpg in Resources */ = {isa = PBXBuildFile; fileRef = E70C8FC815A43013008C0CB6 /* status-bar-pattern-black@2x.jpg */; }; 24 | E70C8FCE15A43013008C0CB6 /* status-bar-pattern-default.jpg in Resources */ = {isa = PBXBuildFile; fileRef = E70C8FC915A43013008C0CB6 /* status-bar-pattern-default.jpg */; }; 25 | E70C8FCF15A43013008C0CB6 /* status-bar-pattern-default@2x.jpg in Resources */ = {isa = PBXBuildFile; fileRef = E70C8FCA15A43013008C0CB6 /* status-bar-pattern-default@2x.jpg */; }; 26 | E747F89715A431F800D5B386 /* FirstViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E70C8FD115A43023008C0CB6 /* FirstViewController.m */; }; 27 | E747F89815A4321100D5B386 /* FirstViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E70C8FD215A43023008C0CB6 /* FirstViewController.xib */; }; 28 | E747F89A15A4747200D5B386 /* status-bar-progress.png in Resources */ = {isa = PBXBuildFile; fileRef = E747F89915A4747200D5B386 /* status-bar-progress.png */; }; 29 | E747F89C15A4752A00D5B386 /* status-bar-progress@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E747F89B15A4752A00D5B386 /* status-bar-progress@2x.png */; }; 30 | /* End PBXBuildFile section */ 31 | 32 | /* Begin PBXContainerItemProxy section */ 33 | E70C8FB115A42FF9008C0CB6 /* PBXContainerItemProxy */ = { 34 | isa = PBXContainerItemProxy; 35 | containerPortal = E70C8F8815A42FF9008C0CB6 /* Project object */; 36 | proxyType = 1; 37 | remoteGlobalIDString = E70C8F9015A42FF9008C0CB6; 38 | remoteInfo = BWStatusBarOverlayExample; 39 | }; 40 | /* End PBXContainerItemProxy section */ 41 | 42 | /* Begin PBXFileReference section */ 43 | E70C8F9115A42FF9008C0CB6 /* BWStatusBarOverlayExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BWStatusBarOverlayExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 44 | E70C8F9515A42FF9008C0CB6 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 45 | E70C8F9715A42FF9008C0CB6 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 46 | E70C8F9915A42FF9008C0CB6 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 47 | E70C8F9D15A42FF9008C0CB6 /* BWStatusBarOverlayExample-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "BWStatusBarOverlayExample-Info.plist"; sourceTree = ""; }; 48 | E70C8F9F15A42FF9008C0CB6 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 49 | E70C8FA115A42FF9008C0CB6 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 50 | E70C8FA315A42FF9008C0CB6 /* BWStatusBarOverlayExample-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "BWStatusBarOverlayExample-Prefix.pch"; sourceTree = ""; }; 51 | E70C8FA415A42FF9008C0CB6 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 52 | E70C8FA515A42FF9008C0CB6 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 53 | E70C8FAC15A42FF9008C0CB6 /* BWStatusBarOverlayExampleTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = BWStatusBarOverlayExampleTests.octest; sourceTree = BUILT_PRODUCTS_DIR; }; 54 | E70C8FAD15A42FF9008C0CB6 /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; }; 55 | E70C8FB515A42FF9008C0CB6 /* BWStatusBarOverlayExampleTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "BWStatusBarOverlayExampleTests-Info.plist"; sourceTree = ""; }; 56 | E70C8FB715A42FF9008C0CB6 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 57 | E70C8FB915A42FF9008C0CB6 /* BWStatusBarOverlayExampleTests.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BWStatusBarOverlayExampleTests.h; sourceTree = ""; }; 58 | E70C8FBA15A42FF9008C0CB6 /* BWStatusBarOverlayExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BWStatusBarOverlayExampleTests.m; sourceTree = ""; }; 59 | E70C8FC515A43013008C0CB6 /* BWStatusBarOverlay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BWStatusBarOverlay.h; sourceTree = ""; }; 60 | E70C8FC615A43013008C0CB6 /* BWStatusBarOverlay.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BWStatusBarOverlay.m; sourceTree = ""; }; 61 | E70C8FC715A43013008C0CB6 /* status-bar-pattern-black.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "status-bar-pattern-black.jpg"; sourceTree = ""; }; 62 | E70C8FC815A43013008C0CB6 /* status-bar-pattern-black@2x.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "status-bar-pattern-black@2x.jpg"; sourceTree = ""; }; 63 | E70C8FC915A43013008C0CB6 /* status-bar-pattern-default.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "status-bar-pattern-default.jpg"; sourceTree = ""; }; 64 | E70C8FCA15A43013008C0CB6 /* status-bar-pattern-default@2x.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "status-bar-pattern-default@2x.jpg"; sourceTree = ""; }; 65 | E70C8FD015A43023008C0CB6 /* FirstViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FirstViewController.h; sourceTree = ""; }; 66 | E70C8FD115A43023008C0CB6 /* FirstViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FirstViewController.m; sourceTree = ""; }; 67 | E70C8FD215A43023008C0CB6 /* FirstViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = FirstViewController.xib; sourceTree = ""; }; 68 | E747F89915A4747200D5B386 /* status-bar-progress.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "status-bar-progress.png"; sourceTree = ""; }; 69 | E747F89B15A4752A00D5B386 /* status-bar-progress@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "status-bar-progress@2x.png"; sourceTree = ""; }; 70 | /* End PBXFileReference section */ 71 | 72 | /* Begin PBXFrameworksBuildPhase section */ 73 | E70C8F8E15A42FF9008C0CB6 /* Frameworks */ = { 74 | isa = PBXFrameworksBuildPhase; 75 | buildActionMask = 2147483647; 76 | files = ( 77 | E70C8F9615A42FF9008C0CB6 /* UIKit.framework in Frameworks */, 78 | E70C8F9815A42FF9008C0CB6 /* Foundation.framework in Frameworks */, 79 | E70C8F9A15A42FF9008C0CB6 /* CoreGraphics.framework in Frameworks */, 80 | ); 81 | runOnlyForDeploymentPostprocessing = 0; 82 | }; 83 | E70C8FA815A42FF9008C0CB6 /* Frameworks */ = { 84 | isa = PBXFrameworksBuildPhase; 85 | buildActionMask = 2147483647; 86 | files = ( 87 | E70C8FAE15A42FF9008C0CB6 /* SenTestingKit.framework in Frameworks */, 88 | E70C8FAF15A42FF9008C0CB6 /* UIKit.framework in Frameworks */, 89 | E70C8FB015A42FF9008C0CB6 /* Foundation.framework in Frameworks */, 90 | ); 91 | runOnlyForDeploymentPostprocessing = 0; 92 | }; 93 | /* End PBXFrameworksBuildPhase section */ 94 | 95 | /* Begin PBXGroup section */ 96 | E70C8F8615A42FF9008C0CB6 = { 97 | isa = PBXGroup; 98 | children = ( 99 | E70C8FC415A43013008C0CB6 /* BWStatusBarOverlay */, 100 | E70C8F9B15A42FF9008C0CB6 /* BWStatusBarOverlayExample */, 101 | E70C8FB315A42FF9008C0CB6 /* BWStatusBarOverlayExampleTests */, 102 | E70C8F9415A42FF9008C0CB6 /* Frameworks */, 103 | E70C8F9215A42FF9008C0CB6 /* Products */, 104 | ); 105 | sourceTree = ""; 106 | }; 107 | E70C8F9215A42FF9008C0CB6 /* Products */ = { 108 | isa = PBXGroup; 109 | children = ( 110 | E70C8F9115A42FF9008C0CB6 /* BWStatusBarOverlayExample.app */, 111 | E70C8FAC15A42FF9008C0CB6 /* BWStatusBarOverlayExampleTests.octest */, 112 | ); 113 | name = Products; 114 | sourceTree = ""; 115 | }; 116 | E70C8F9415A42FF9008C0CB6 /* Frameworks */ = { 117 | isa = PBXGroup; 118 | children = ( 119 | E70C8F9515A42FF9008C0CB6 /* UIKit.framework */, 120 | E70C8F9715A42FF9008C0CB6 /* Foundation.framework */, 121 | E70C8F9915A42FF9008C0CB6 /* CoreGraphics.framework */, 122 | E70C8FAD15A42FF9008C0CB6 /* SenTestingKit.framework */, 123 | ); 124 | name = Frameworks; 125 | sourceTree = ""; 126 | }; 127 | E70C8F9B15A42FF9008C0CB6 /* BWStatusBarOverlayExample */ = { 128 | isa = PBXGroup; 129 | children = ( 130 | E70C8FD015A43023008C0CB6 /* FirstViewController.h */, 131 | E70C8FD115A43023008C0CB6 /* FirstViewController.m */, 132 | E70C8FD215A43023008C0CB6 /* FirstViewController.xib */, 133 | E70C8FA415A42FF9008C0CB6 /* AppDelegate.h */, 134 | E70C8FA515A42FF9008C0CB6 /* AppDelegate.m */, 135 | E70C8F9C15A42FF9008C0CB6 /* Supporting Files */, 136 | ); 137 | path = BWStatusBarOverlayExample; 138 | sourceTree = ""; 139 | }; 140 | E70C8F9C15A42FF9008C0CB6 /* Supporting Files */ = { 141 | isa = PBXGroup; 142 | children = ( 143 | E70C8F9D15A42FF9008C0CB6 /* BWStatusBarOverlayExample-Info.plist */, 144 | E70C8F9E15A42FF9008C0CB6 /* InfoPlist.strings */, 145 | E70C8FA115A42FF9008C0CB6 /* main.m */, 146 | E70C8FA315A42FF9008C0CB6 /* BWStatusBarOverlayExample-Prefix.pch */, 147 | ); 148 | name = "Supporting Files"; 149 | sourceTree = ""; 150 | }; 151 | E70C8FB315A42FF9008C0CB6 /* BWStatusBarOverlayExampleTests */ = { 152 | isa = PBXGroup; 153 | children = ( 154 | E70C8FB915A42FF9008C0CB6 /* BWStatusBarOverlayExampleTests.h */, 155 | E70C8FBA15A42FF9008C0CB6 /* BWStatusBarOverlayExampleTests.m */, 156 | E70C8FB415A42FF9008C0CB6 /* Supporting Files */, 157 | ); 158 | path = BWStatusBarOverlayExampleTests; 159 | sourceTree = ""; 160 | }; 161 | E70C8FB415A42FF9008C0CB6 /* Supporting Files */ = { 162 | isa = PBXGroup; 163 | children = ( 164 | E70C8FB515A42FF9008C0CB6 /* BWStatusBarOverlayExampleTests-Info.plist */, 165 | E70C8FB615A42FF9008C0CB6 /* InfoPlist.strings */, 166 | ); 167 | name = "Supporting Files"; 168 | sourceTree = ""; 169 | }; 170 | E70C8FC415A43013008C0CB6 /* BWStatusBarOverlay */ = { 171 | isa = PBXGroup; 172 | children = ( 173 | E70C8FC515A43013008C0CB6 /* BWStatusBarOverlay.h */, 174 | E70C8FC615A43013008C0CB6 /* BWStatusBarOverlay.m */, 175 | E747F89915A4747200D5B386 /* status-bar-progress.png */, 176 | E747F89B15A4752A00D5B386 /* status-bar-progress@2x.png */, 177 | E70C8FC715A43013008C0CB6 /* status-bar-pattern-black.jpg */, 178 | E70C8FC815A43013008C0CB6 /* status-bar-pattern-black@2x.jpg */, 179 | E70C8FC915A43013008C0CB6 /* status-bar-pattern-default.jpg */, 180 | E70C8FCA15A43013008C0CB6 /* status-bar-pattern-default@2x.jpg */, 181 | ); 182 | path = BWStatusBarOverlay; 183 | sourceTree = ""; 184 | }; 185 | /* End PBXGroup section */ 186 | 187 | /* Begin PBXNativeTarget section */ 188 | E70C8F9015A42FF9008C0CB6 /* BWStatusBarOverlayExample */ = { 189 | isa = PBXNativeTarget; 190 | buildConfigurationList = E70C8FBE15A42FF9008C0CB6 /* Build configuration list for PBXNativeTarget "BWStatusBarOverlayExample" */; 191 | buildPhases = ( 192 | E70C8F8D15A42FF9008C0CB6 /* Sources */, 193 | E70C8F8E15A42FF9008C0CB6 /* Frameworks */, 194 | E70C8F8F15A42FF9008C0CB6 /* Resources */, 195 | ); 196 | buildRules = ( 197 | ); 198 | dependencies = ( 199 | ); 200 | name = BWStatusBarOverlayExample; 201 | productName = BWStatusBarOverlayExample; 202 | productReference = E70C8F9115A42FF9008C0CB6 /* BWStatusBarOverlayExample.app */; 203 | productType = "com.apple.product-type.application"; 204 | }; 205 | E70C8FAB15A42FF9008C0CB6 /* BWStatusBarOverlayExampleTests */ = { 206 | isa = PBXNativeTarget; 207 | buildConfigurationList = E70C8FC115A42FF9008C0CB6 /* Build configuration list for PBXNativeTarget "BWStatusBarOverlayExampleTests" */; 208 | buildPhases = ( 209 | E70C8FA715A42FF9008C0CB6 /* Sources */, 210 | E70C8FA815A42FF9008C0CB6 /* Frameworks */, 211 | E70C8FA915A42FF9008C0CB6 /* Resources */, 212 | E70C8FAA15A42FF9008C0CB6 /* ShellScript */, 213 | ); 214 | buildRules = ( 215 | ); 216 | dependencies = ( 217 | E70C8FB215A42FF9008C0CB6 /* PBXTargetDependency */, 218 | ); 219 | name = BWStatusBarOverlayExampleTests; 220 | productName = BWStatusBarOverlayExampleTests; 221 | productReference = E70C8FAC15A42FF9008C0CB6 /* BWStatusBarOverlayExampleTests.octest */; 222 | productType = "com.apple.product-type.bundle"; 223 | }; 224 | /* End PBXNativeTarget section */ 225 | 226 | /* Begin PBXProject section */ 227 | E70C8F8815A42FF9008C0CB6 /* Project object */ = { 228 | isa = PBXProject; 229 | attributes = { 230 | LastUpgradeCheck = 0430; 231 | }; 232 | buildConfigurationList = E70C8F8B15A42FF9008C0CB6 /* Build configuration list for PBXProject "BWStatusBarOverlayExample" */; 233 | compatibilityVersion = "Xcode 3.2"; 234 | developmentRegion = English; 235 | hasScannedForEncodings = 0; 236 | knownRegions = ( 237 | en, 238 | ); 239 | mainGroup = E70C8F8615A42FF9008C0CB6; 240 | productRefGroup = E70C8F9215A42FF9008C0CB6 /* Products */; 241 | projectDirPath = ""; 242 | projectRoot = ""; 243 | targets = ( 244 | E70C8F9015A42FF9008C0CB6 /* BWStatusBarOverlayExample */, 245 | E70C8FAB15A42FF9008C0CB6 /* BWStatusBarOverlayExampleTests */, 246 | ); 247 | }; 248 | /* End PBXProject section */ 249 | 250 | /* Begin PBXResourcesBuildPhase section */ 251 | E70C8F8F15A42FF9008C0CB6 /* Resources */ = { 252 | isa = PBXResourcesBuildPhase; 253 | buildActionMask = 2147483647; 254 | files = ( 255 | E70C8FA015A42FF9008C0CB6 /* InfoPlist.strings in Resources */, 256 | E70C8FCC15A43013008C0CB6 /* status-bar-pattern-black.jpg in Resources */, 257 | E70C8FCD15A43013008C0CB6 /* status-bar-pattern-black@2x.jpg in Resources */, 258 | E70C8FCE15A43013008C0CB6 /* status-bar-pattern-default.jpg in Resources */, 259 | E70C8FCF15A43013008C0CB6 /* status-bar-pattern-default@2x.jpg in Resources */, 260 | E747F89815A4321100D5B386 /* FirstViewController.xib in Resources */, 261 | E747F89A15A4747200D5B386 /* status-bar-progress.png in Resources */, 262 | E747F89C15A4752A00D5B386 /* status-bar-progress@2x.png in Resources */, 263 | ); 264 | runOnlyForDeploymentPostprocessing = 0; 265 | }; 266 | E70C8FA915A42FF9008C0CB6 /* Resources */ = { 267 | isa = PBXResourcesBuildPhase; 268 | buildActionMask = 2147483647; 269 | files = ( 270 | E70C8FB815A42FF9008C0CB6 /* InfoPlist.strings in Resources */, 271 | ); 272 | runOnlyForDeploymentPostprocessing = 0; 273 | }; 274 | /* End PBXResourcesBuildPhase section */ 275 | 276 | /* Begin PBXShellScriptBuildPhase section */ 277 | E70C8FAA15A42FF9008C0CB6 /* ShellScript */ = { 278 | isa = PBXShellScriptBuildPhase; 279 | buildActionMask = 2147483647; 280 | files = ( 281 | ); 282 | inputPaths = ( 283 | ); 284 | outputPaths = ( 285 | ); 286 | runOnlyForDeploymentPostprocessing = 0; 287 | shellPath = /bin/sh; 288 | shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n"; 289 | }; 290 | /* End PBXShellScriptBuildPhase section */ 291 | 292 | /* Begin PBXSourcesBuildPhase section */ 293 | E70C8F8D15A42FF9008C0CB6 /* Sources */ = { 294 | isa = PBXSourcesBuildPhase; 295 | buildActionMask = 2147483647; 296 | files = ( 297 | E70C8FA215A42FF9008C0CB6 /* main.m in Sources */, 298 | E70C8FA615A42FF9008C0CB6 /* AppDelegate.m in Sources */, 299 | E70C8FCB15A43013008C0CB6 /* BWStatusBarOverlay.m in Sources */, 300 | E747F89715A431F800D5B386 /* FirstViewController.m in Sources */, 301 | ); 302 | runOnlyForDeploymentPostprocessing = 0; 303 | }; 304 | E70C8FA715A42FF9008C0CB6 /* Sources */ = { 305 | isa = PBXSourcesBuildPhase; 306 | buildActionMask = 2147483647; 307 | files = ( 308 | E70C8FBB15A42FF9008C0CB6 /* BWStatusBarOverlayExampleTests.m in Sources */, 309 | ); 310 | runOnlyForDeploymentPostprocessing = 0; 311 | }; 312 | /* End PBXSourcesBuildPhase section */ 313 | 314 | /* Begin PBXTargetDependency section */ 315 | E70C8FB215A42FF9008C0CB6 /* PBXTargetDependency */ = { 316 | isa = PBXTargetDependency; 317 | target = E70C8F9015A42FF9008C0CB6 /* BWStatusBarOverlayExample */; 318 | targetProxy = E70C8FB115A42FF9008C0CB6 /* PBXContainerItemProxy */; 319 | }; 320 | /* End PBXTargetDependency section */ 321 | 322 | /* Begin PBXVariantGroup section */ 323 | E70C8F9E15A42FF9008C0CB6 /* InfoPlist.strings */ = { 324 | isa = PBXVariantGroup; 325 | children = ( 326 | E70C8F9F15A42FF9008C0CB6 /* en */, 327 | ); 328 | name = InfoPlist.strings; 329 | sourceTree = ""; 330 | }; 331 | E70C8FB615A42FF9008C0CB6 /* InfoPlist.strings */ = { 332 | isa = PBXVariantGroup; 333 | children = ( 334 | E70C8FB715A42FF9008C0CB6 /* en */, 335 | ); 336 | name = InfoPlist.strings; 337 | sourceTree = ""; 338 | }; 339 | /* End PBXVariantGroup section */ 340 | 341 | /* Begin XCBuildConfiguration section */ 342 | E70C8FBC15A42FF9008C0CB6 /* Debug */ = { 343 | isa = XCBuildConfiguration; 344 | buildSettings = { 345 | ALWAYS_SEARCH_USER_PATHS = NO; 346 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 347 | CLANG_ENABLE_OBJC_ARC = YES; 348 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 349 | COPY_PHASE_STRIP = NO; 350 | GCC_C_LANGUAGE_STANDARD = gnu99; 351 | GCC_DYNAMIC_NO_PIC = NO; 352 | GCC_OPTIMIZATION_LEVEL = 0; 353 | GCC_PREPROCESSOR_DEFINITIONS = ( 354 | "DEBUG=1", 355 | "$(inherited)", 356 | ); 357 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 358 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 359 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 360 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 361 | GCC_WARN_UNUSED_VARIABLE = YES; 362 | IPHONEOS_DEPLOYMENT_TARGET = 5.1; 363 | SDKROOT = iphoneos; 364 | TARGETED_DEVICE_FAMILY = "1,2"; 365 | }; 366 | name = Debug; 367 | }; 368 | E70C8FBD15A42FF9008C0CB6 /* Release */ = { 369 | isa = XCBuildConfiguration; 370 | buildSettings = { 371 | ALWAYS_SEARCH_USER_PATHS = NO; 372 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 373 | CLANG_ENABLE_OBJC_ARC = YES; 374 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 375 | COPY_PHASE_STRIP = YES; 376 | GCC_C_LANGUAGE_STANDARD = gnu99; 377 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 378 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 379 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 380 | GCC_WARN_UNUSED_VARIABLE = YES; 381 | IPHONEOS_DEPLOYMENT_TARGET = 5.1; 382 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 383 | SDKROOT = iphoneos; 384 | TARGETED_DEVICE_FAMILY = "1,2"; 385 | VALIDATE_PRODUCT = YES; 386 | }; 387 | name = Release; 388 | }; 389 | E70C8FBF15A42FF9008C0CB6 /* Debug */ = { 390 | isa = XCBuildConfiguration; 391 | buildSettings = { 392 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 393 | GCC_PREFIX_HEADER = "BWStatusBarOverlayExample/BWStatusBarOverlayExample-Prefix.pch"; 394 | INFOPLIST_FILE = "BWStatusBarOverlayExample/BWStatusBarOverlayExample-Info.plist"; 395 | PRODUCT_NAME = "$(TARGET_NAME)"; 396 | WRAPPER_EXTENSION = app; 397 | }; 398 | name = Debug; 399 | }; 400 | E70C8FC015A42FF9008C0CB6 /* Release */ = { 401 | isa = XCBuildConfiguration; 402 | buildSettings = { 403 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 404 | GCC_PREFIX_HEADER = "BWStatusBarOverlayExample/BWStatusBarOverlayExample-Prefix.pch"; 405 | INFOPLIST_FILE = "BWStatusBarOverlayExample/BWStatusBarOverlayExample-Info.plist"; 406 | PRODUCT_NAME = "$(TARGET_NAME)"; 407 | WRAPPER_EXTENSION = app; 408 | }; 409 | name = Release; 410 | }; 411 | E70C8FC215A42FF9008C0CB6 /* Debug */ = { 412 | isa = XCBuildConfiguration; 413 | buildSettings = { 414 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/BWStatusBarOverlayExample.app/BWStatusBarOverlayExample"; 415 | FRAMEWORK_SEARCH_PATHS = ( 416 | "$(SDKROOT)/Developer/Library/Frameworks", 417 | "$(DEVELOPER_LIBRARY_DIR)/Frameworks", 418 | ); 419 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 420 | GCC_PREFIX_HEADER = "BWStatusBarOverlayExample/BWStatusBarOverlayExample-Prefix.pch"; 421 | INFOPLIST_FILE = "BWStatusBarOverlayExampleTests/BWStatusBarOverlayExampleTests-Info.plist"; 422 | PRODUCT_NAME = "$(TARGET_NAME)"; 423 | TEST_HOST = "$(BUNDLE_LOADER)"; 424 | WRAPPER_EXTENSION = octest; 425 | }; 426 | name = Debug; 427 | }; 428 | E70C8FC315A42FF9008C0CB6 /* Release */ = { 429 | isa = XCBuildConfiguration; 430 | buildSettings = { 431 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/BWStatusBarOverlayExample.app/BWStatusBarOverlayExample"; 432 | FRAMEWORK_SEARCH_PATHS = ( 433 | "$(SDKROOT)/Developer/Library/Frameworks", 434 | "$(DEVELOPER_LIBRARY_DIR)/Frameworks", 435 | ); 436 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 437 | GCC_PREFIX_HEADER = "BWStatusBarOverlayExample/BWStatusBarOverlayExample-Prefix.pch"; 438 | INFOPLIST_FILE = "BWStatusBarOverlayExampleTests/BWStatusBarOverlayExampleTests-Info.plist"; 439 | PRODUCT_NAME = "$(TARGET_NAME)"; 440 | TEST_HOST = "$(BUNDLE_LOADER)"; 441 | WRAPPER_EXTENSION = octest; 442 | }; 443 | name = Release; 444 | }; 445 | /* End XCBuildConfiguration section */ 446 | 447 | /* Begin XCConfigurationList section */ 448 | E70C8F8B15A42FF9008C0CB6 /* Build configuration list for PBXProject "BWStatusBarOverlayExample" */ = { 449 | isa = XCConfigurationList; 450 | buildConfigurations = ( 451 | E70C8FBC15A42FF9008C0CB6 /* Debug */, 452 | E70C8FBD15A42FF9008C0CB6 /* Release */, 453 | ); 454 | defaultConfigurationIsVisible = 0; 455 | defaultConfigurationName = Release; 456 | }; 457 | E70C8FBE15A42FF9008C0CB6 /* Build configuration list for PBXNativeTarget "BWStatusBarOverlayExample" */ = { 458 | isa = XCConfigurationList; 459 | buildConfigurations = ( 460 | E70C8FBF15A42FF9008C0CB6 /* Debug */, 461 | E70C8FC015A42FF9008C0CB6 /* Release */, 462 | ); 463 | defaultConfigurationIsVisible = 0; 464 | defaultConfigurationName = Release; 465 | }; 466 | E70C8FC115A42FF9008C0CB6 /* Build configuration list for PBXNativeTarget "BWStatusBarOverlayExampleTests" */ = { 467 | isa = XCConfigurationList; 468 | buildConfigurations = ( 469 | E70C8FC215A42FF9008C0CB6 /* Debug */, 470 | E70C8FC315A42FF9008C0CB6 /* Release */, 471 | ); 472 | defaultConfigurationIsVisible = 0; 473 | defaultConfigurationName = Release; 474 | }; 475 | /* End XCConfigurationList section */ 476 | }; 477 | rootObject = E70C8F8815A42FF9008C0CB6 /* Project object */; 478 | } 479 | -------------------------------------------------------------------------------- /BWStatusBarOverlay/BWStatusBarOverlay.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Bruno Wernimont on 2012 3 | // Copyright 2012 BWLongTextViewController 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | 18 | #import "BWStatusBarOverlay.h" 19 | 20 | #import 21 | 22 | #define ROTATION_ANIMATION_DURATION [UIApplication sharedApplication].statusBarOrientationAnimationDuration 23 | #define STATUS_BAR_HEIGHT CGRectGetHeight([UIApplication sharedApplication].statusBarFrame) 24 | #define STATUS_BAR_WIDTH CGRectGetWidth([UIApplication sharedApplication].statusBarFrame) 25 | #define STATUS_BAR_ORIENTATION [UIApplication sharedApplication].statusBarOrientation 26 | #define IS_IPAD UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad 27 | 28 | #define TEXT_LABEL_FONT [UIFont boldSystemFontOfSize:12] 29 | 30 | 31 | //////////////////////////////////////////////////////////////////////////////////////////////////// 32 | //////////////////////////////////////////////////////////////////////////////////////////////////// 33 | //////////////////////////////////////////////////////////////////////////////////////////////////// 34 | @interface BWStatusBarOverlay () 35 | 36 | - (void)animatateview:(UIView *)view show:(BOOL)show completion:(BWStatusBarBasicBlock)completion; 37 | 38 | - (void)animatateview:(UIView *)view 39 | withAnimationType:(BWStatusBarOverlayAnimationType)animationType 40 | show:(BOOL)show 41 | completion:(BWStatusBarBasicBlock)completion; 42 | 43 | - (void)fromTopAnimatateview:(UIView *)view show:(BOOL)show completion:(BWStatusBarBasicBlock)completion; 44 | 45 | - (void)fadeAnimatateview:(UIView *)view show:(BOOL)show completion:(BWStatusBarBasicBlock)completion; 46 | 47 | - (void)initializeToDefaultState; 48 | 49 | - (void)rotateStatusBarWithFrame:(NSValue *)frameValue; 50 | 51 | - (void)rotateStatusBarAnimatedWithFrame:(NSValue *)frameValue; 52 | 53 | - (void)showMessage:(NSString *)message 54 | withStatus:(BWStatusBarOverlayStatus)status 55 | duration:(NSTimeInterval)duration 56 | animated:(BOOL)animated; 57 | 58 | - (void)setStatusBarStyle:(UIStatusBarStyle)statusBarStyle; 59 | 60 | @end 61 | 62 | 63 | //////////////////////////////////////////////////////////////////////////////////////////////////// 64 | //////////////////////////////////////////////////////////////////////////////////////////////////// 65 | //////////////////////////////////////////////////////////////////////////////////////////////////// 66 | @implementation BWStatusBarOverlay 67 | 68 | @synthesize progress = _progress; 69 | @synthesize activityView = _activityView; 70 | @synthesize textLabel = _textLabel; 71 | @synthesize animation = _animation; 72 | @synthesize actionBlock = _actionBlock; 73 | @synthesize contentView = _contentView; 74 | @synthesize statusLabel = _statusLabel; 75 | 76 | 77 | //////////////////////////////////////////////////////////////////////////////////////////////////// 78 | - (void)dealloc { 79 | [[NSNotificationCenter defaultCenter] removeObserver:self]; 80 | } 81 | 82 | 83 | //////////////////////////////////////////////////////////////////////////////////////////////////// 84 | + (BWStatusBarOverlay *)shared { 85 | static dispatch_once_t pred = 0; 86 | __strong static id _sharedObject = nil; 87 | dispatch_once(&pred, ^{ 88 | _sharedObject = [[self alloc] init]; 89 | }); 90 | return _sharedObject; 91 | } 92 | 93 | 94 | //////////////////////////////////////////////////////////////////////////////////////////////////// 95 | - (id)init { 96 | self = [super initWithFrame:CGRectZero]; 97 | if (self) { 98 | self.windowLevel = UIWindowLevelStatusBar + 1; 99 | self.animation = BWStatusBarOverlayAnimationTypeFade; 100 | 101 | BOOL isPortrait = UIDeviceOrientationIsPortrait(STATUS_BAR_ORIENTATION); 102 | CGRect statusBarFrame = [UIApplication sharedApplication].statusBarFrame; 103 | CGFloat statusBarHeight = (isPortrait) ? statusBarFrame.size.height : statusBarFrame.size.width; 104 | CGFloat statusBarWidth = (isPortrait) ? statusBarFrame.size.width : statusBarFrame.size.height; 105 | 106 | self.frame = CGRectMake(0, 0, statusBarWidth, statusBarHeight); 107 | 108 | _contentView = [[UIView alloc] initWithFrame:self.frame]; 109 | self.contentView.autoresizingMask = UIViewAutoresizingFlexibleWidth; 110 | [self addSubview:self.contentView]; 111 | 112 | _progressView = [[UIView alloc] initWithFrame:self.frame]; 113 | _progressView.frame = CGRectMake(0, 0, 0, CGRectGetHeight(self.frame)); 114 | [self.contentView addSubview:_progressView]; 115 | 116 | _activityView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite]; 117 | self.activityView.frame = CGRectMake(4, 4, statusBarHeight - 4 * 2, statusBarHeight - 4 * 2); 118 | self.activityView.hidesWhenStopped = YES; 119 | 120 | if ([self.activityView respondsToSelector:@selector(setColor:)]) { // IOS5 or greater 121 | [self.activityView.layer setValue:[NSNumber numberWithFloat:0.7f] forKeyPath:@"transform.scale"]; 122 | } 123 | 124 | [self.contentView addSubview:self.activityView]; 125 | 126 | _statusLabel = [[UILabel alloc] initWithFrame:self.activityView.frame]; 127 | self.statusLabel.backgroundColor = [UIColor clearColor]; 128 | 129 | #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_6 130 | self.statusLabel.textAlignment = UITextAlignmentCenter; 131 | #else 132 | self.statusLabel.textAlignment = NSTextAlignmentCenter; 133 | #endif 134 | [self.contentView addSubview:self.statusLabel]; 135 | 136 | _textLabel = [[UILabel alloc] initWithFrame:CGRectZero]; 137 | self.textLabel.frame = CGRectMake(CGRectGetWidth(self.activityView.frame) + 10, 138 | 0, 139 | statusBarWidth - (CGRectGetWidth(self.activityView.frame) * 2) - (10 * 2), 140 | statusBarHeight); 141 | self.textLabel.backgroundColor = [UIColor clearColor]; 142 | self.textLabel.font = TEXT_LABEL_FONT; 143 | #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_6 144 | self.textLabel.textAlignment = UITextAlignmentCenter; 145 | #else 146 | self.textLabel.textAlignment = NSTextAlignmentCenter; 147 | #endif 148 | [self.contentView addSubview:self.textLabel]; 149 | 150 | UITapGestureRecognizer *tapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didPressOnView:)]; 151 | [self addGestureRecognizer:tapGestureRecognizer]; 152 | 153 | [[NSNotificationCenter defaultCenter] addObserver:self 154 | selector:@selector(willRotateScreen:) 155 | name:UIApplicationWillChangeStatusBarFrameNotification object:nil]; 156 | 157 | self.textLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth; 158 | 159 | [self setProgressBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"status-bar-progress.png"]]]; 160 | self.statusLabel.textColor = self.textLabel.textColor; 161 | 162 | [self initializeToDefaultState]; 163 | } 164 | 165 | return self; 166 | } 167 | 168 | 169 | //////////////////////////////////////////////////////////////////////////////////////////////////// 170 | //////////////////////////////////////////////////////////////////////////////////////////////////// 171 | #pragma mark - 172 | #pragma mark Public 173 | 174 | 175 | //////////////////////////////////////////////////////////////////////////////////////////////////// 176 | - (void)showWithMessage:(NSString *)message animated:(BOOL)animated { 177 | [self showWithMessage:message loading:NO animated:animated]; 178 | } 179 | 180 | 181 | //////////////////////////////////////////////////////////////////////////////////////////////////// 182 | - (void)showLoadingWithMessage:(NSString *)message animated:(BOOL)animated { 183 | [self showWithMessage:message loading:YES animated:animated]; 184 | } 185 | 186 | 187 | //////////////////////////////////////////////////////////////////////////////////////////////////// 188 | - (void)showWithMessage:(NSString *)message loading:(BOOL)loading animated:(BOOL)animated { 189 | [self initializeToDefaultState]; 190 | self.textLabel.text = message; 191 | self.hidden = NO; 192 | 193 | if (YES == loading) { 194 | [self.activityView startAnimating]; 195 | } else { 196 | [self.activityView stopAnimating]; 197 | } 198 | 199 | if (animated) { 200 | [self animatateview:self.contentView show:YES completion:nil]; 201 | } 202 | } 203 | 204 | 205 | //////////////////////////////////////////////////////////////////////////////////////////////////// 206 | - (void)setMessage:(NSString *)message animated:(BOOL)animated { 207 | if (animated) { 208 | [self animatateview:self.textLabel show:NO completion:^{ 209 | self.textLabel.text = message; 210 | [self animatateview:self.textLabel show:YES completion:nil]; 211 | }]; 212 | } else { 213 | self.textLabel.text = message; 214 | } 215 | } 216 | 217 | 218 | //////////////////////////////////////////////////////////////////////////////////////////////////// 219 | - (void)setProgress:(float)progress animated:(BOOL)animated { 220 | _progress = progress; 221 | 222 | CGRect frame = _progressView.frame; 223 | CGFloat width = CGRectGetWidth(self.bounds); 224 | frame.size.width = width * _progress; 225 | 226 | if (animated) { 227 | [UIView animateWithDuration:0.33 animations:^{ 228 | _progressView.frame = frame; 229 | }]; 230 | } else { 231 | _progressView.frame = frame; 232 | } 233 | } 234 | 235 | 236 | //////////////////////////////////////////////////////////////////////////////////////////////////// 237 | - (void)showActivity:(BOOL)show animated:(BOOL)animated { 238 | if (show) { 239 | [self.activityView startAnimating]; 240 | } else if (NO == animated) { 241 | [self.activityView stopAnimating]; 242 | } 243 | 244 | if (animated) { 245 | [self animatateview:self.activityView show:show completion:^{ 246 | if (NO == show) { 247 | [self.activityView stopAnimating]; 248 | } 249 | }]; 250 | } else { 251 | self.activityView.hidden = !show; 252 | } 253 | } 254 | 255 | 256 | //////////////////////////////////////////////////////////////////////////////////////////////////// 257 | - (void)showSuccessWithMessage:(NSString *)message duration:(NSTimeInterval)duration animated:(BOOL)animated { 258 | [self showMessage:message 259 | withStatus:BWStatusBarOverlayStatusSuccess 260 | duration:duration 261 | animated:animated]; 262 | } 263 | 264 | 265 | //////////////////////////////////////////////////////////////////////////////////////////////////// 266 | - (void)showErrorWithMessage:(NSString *)message duration:(NSTimeInterval)duration animated:(BOOL)animated { 267 | [self showMessage:message 268 | withStatus:BWStatusBarOverlayStatusError 269 | duration:duration 270 | animated:animated]; 271 | } 272 | 273 | 274 | //////////////////////////////////////////////////////////////////////////////////////////////////// 275 | - (void)dismissAnimated:(BOOL)animated { 276 | if (animated) { 277 | [self animatateview:self.contentView show:NO completion:^{ 278 | self.hidden = YES; 279 | }]; 280 | } else { 281 | self.hidden = YES; 282 | } 283 | } 284 | 285 | 286 | //////////////////////////////////////////////////////////////////////////////////////////////////// 287 | - (void)dismissAnimated { 288 | [self dismissAnimated:YES]; 289 | } 290 | 291 | 292 | //////////////////////////////////////////////////////////////////////////////////////////////////// 293 | - (void)dismiss { 294 | [self dismissAnimated:NO]; 295 | } 296 | 297 | 298 | //////////////////////////////////////////////////////////////////////////////////////////////////// 299 | - (void)setBackgroundColor:(UIColor *)backgroundColor { 300 | [self.contentView setBackgroundColor:backgroundColor]; 301 | } 302 | 303 | 304 | //////////////////////////////////////////////////////////////////////////////////////////////////// 305 | - (void)setStatusBarStyle:(UIStatusBarStyle)statusBarStyle animated:(BOOL)animated { 306 | if (animated) { 307 | [self animatateview:self.contentView show:NO completion:^{ 308 | [self setStatusBarStyle:statusBarStyle]; 309 | [self animatateview:self.contentView show:YES completion:nil]; 310 | }]; 311 | } else { 312 | [self setStatusBarStyle:statusBarStyle]; 313 | } 314 | } 315 | 316 | 317 | //////////////////////////////////////////////////////////////////////////////////////////////////// 318 | //////////////////////////////////////////////////////////////////////////////////////////////////// 319 | #pragma mark - 320 | #pragma mark Getters and setters 321 | 322 | 323 | //////////////////////////////////////////////////////////////////////////////////////////////////// 324 | - (void)setProgressBackgroundColor:(UIColor *)progressBackgroundColor { 325 | _progressView.backgroundColor = progressBackgroundColor; 326 | } 327 | 328 | 329 | //////////////////////////////////////////////////////////////////////////////////////////////////// 330 | - (UIColor *)progressBackgroundColor { 331 | return _progressView.backgroundColor; 332 | } 333 | 334 | 335 | //////////////////////////////////////////////////////////////////////////////////////////////////// 336 | - (void)setProgress:(float)progress { 337 | [self setProgress:progress animated:NO]; 338 | } 339 | 340 | 341 | //////////////////////////////////////////////////////////////////////////////////////////////////// 342 | //////////////////////////////////////////////////////////////////////////////////////////////////// 343 | #pragma mark - 344 | #pragma mark Class methods 345 | 346 | 347 | //////////////////////////////////////////////////////////////////////////////////////////////////// 348 | + (void)showWithMessage:(NSString *)message loading:(BOOL)loading animated:(BOOL)animated { 349 | [[BWStatusBarOverlay shared] showWithMessage:message loading:loading animated:animated]; 350 | } 351 | 352 | 353 | //////////////////////////////////////////////////////////////////////////////////////////////////// 354 | + (void)showWithMessage:(NSString *)message animated:(BOOL)animated { 355 | [[BWStatusBarOverlay shared] showWithMessage:message animated:animated]; 356 | } 357 | 358 | 359 | //////////////////////////////////////////////////////////////////////////////////////////////////// 360 | + (void)showLoadingWithMessage:(NSString *)message animated:(BOOL)animated { 361 | [[BWStatusBarOverlay shared] showLoadingWithMessage:message animated:animated]; 362 | } 363 | 364 | 365 | //////////////////////////////////////////////////////////////////////////////////////////////////// 366 | + (void)setMessage:(NSString *)message animated:(BOOL)animated { 367 | [[BWStatusBarOverlay shared] setMessage:message animated:animated]; 368 | } 369 | 370 | 371 | //////////////////////////////////////////////////////////////////////////////////////////////////// 372 | + (void)showSuccessWithMessage:(NSString *)message duration:(NSTimeInterval)duration animated:(BOOL)animated { 373 | [[BWStatusBarOverlay shared] showSuccessWithMessage:message duration:duration animated:animated]; 374 | } 375 | 376 | 377 | //////////////////////////////////////////////////////////////////////////////////////////////////// 378 | + (void)showErrorWithMessage:(NSString *)message duration:(NSTimeInterval)duration animated:(BOOL)animated { 379 | [[BWStatusBarOverlay shared] showErrorWithMessage:message duration:duration animated:animated]; 380 | } 381 | 382 | 383 | //////////////////////////////////////////////////////////////////////////////////////////////////// 384 | + (void)setAnimation:(BWStatusBarOverlayAnimationType)animation { 385 | [[BWStatusBarOverlay shared] setAnimation:animation]; 386 | } 387 | 388 | 389 | //////////////////////////////////////////////////////////////////////////////////////////////////// 390 | + (void)dismissAnimated:(BOOL)animated { 391 | [[BWStatusBarOverlay shared] dismissAnimated:animated]; 392 | } 393 | 394 | 395 | //////////////////////////////////////////////////////////////////////////////////////////////////// 396 | + (void)dismissAnimated { 397 | [[BWStatusBarOverlay shared] dismissAnimated]; 398 | } 399 | 400 | 401 | //////////////////////////////////////////////////////////////////////////////////////////////////// 402 | + (void)dismiss { 403 | [[BWStatusBarOverlay shared] dismiss]; 404 | } 405 | 406 | 407 | //////////////////////////////////////////////////////////////////////////////////////////////////// 408 | + (void)setProgress:(float)progress animated:(BOOL)animated { 409 | [[BWStatusBarOverlay shared] setProgress:progress animated:animated]; 410 | } 411 | 412 | 413 | //////////////////////////////////////////////////////////////////////////////////////////////////// 414 | + (void)showActivity:(BOOL)show animated:(BOOL)animated { 415 | [[BWStatusBarOverlay shared] showActivity:show animated:animated]; 416 | } 417 | 418 | 419 | //////////////////////////////////////////////////////////////////////////////////////////////////// 420 | + (void)setBackgroundColor:(UIColor *)backgroundColor { 421 | [[BWStatusBarOverlay shared] setBackgroundColor:backgroundColor]; 422 | } 423 | 424 | 425 | //////////////////////////////////////////////////////////////////////////////////////////////////// 426 | + (void)setStatusBarStyle:(UIStatusBarStyle)statusBarStyle animated:(BOOL)animated { 427 | [[BWStatusBarOverlay shared] setStatusBarStyle:statusBarStyle animated:animated]; 428 | } 429 | 430 | 431 | //////////////////////////////////////////////////////////////////////////////////////////////////// 432 | + (void)setActionBlock:(BWStatusBarBasicBlock)actionBlock { 433 | [[BWStatusBarOverlay shared] setActionBlock:actionBlock]; 434 | } 435 | 436 | 437 | //////////////////////////////////////////////////////////////////////////////////////////////////// 438 | + (void)setProgressBackgroundColor:(UIColor *)backgroundColor { 439 | [[BWStatusBarOverlay shared] setProgressBackgroundColor:backgroundColor]; 440 | } 441 | 442 | 443 | //////////////////////////////////////////////////////////////////////////////////////////////////// 444 | //////////////////////////////////////////////////////////////////////////////////////////////////// 445 | #pragma mark - 446 | #pragma mark Gesture recognizer 447 | 448 | 449 | //////////////////////////////////////////////////////////////////////////////////////////////////// 450 | - (void)didPressOnView:(UIGestureRecognizer *)gestureRecognizer { 451 | if (nil != _actionBlock) { 452 | _actionBlock(); 453 | } 454 | } 455 | 456 | 457 | //////////////////////////////////////////////////////////////////////////////////////////////////// 458 | //////////////////////////////////////////////////////////////////////////////////////////////////// 459 | #pragma mark - 460 | #pragma mark Rotation 461 | 462 | 463 | //////////////////////////////////////////////////////////////////////////////////////////////////// 464 | - (void)willRotateScreen:(NSNotification *)notification { 465 | NSValue *frameValue = [notification.userInfo valueForKey:UIApplicationStatusBarFrameUserInfoKey]; 466 | 467 | if (NO == self.hidden) { 468 | [self rotateStatusBarAnimatedWithFrame:frameValue]; 469 | } else { 470 | [self rotateStatusBarWithFrame:frameValue]; 471 | } 472 | } 473 | 474 | 475 | //////////////////////////////////////////////////////////////////////////////////////////////////// 476 | //////////////////////////////////////////////////////////////////////////////////////////////////// 477 | #pragma mark - 478 | #pragma mark Private 479 | 480 | 481 | //////////////////////////////////////////////////////////////////////////////////////////////////// 482 | - (void)setStatusBarStyle:(UIStatusBarStyle)statusBarStyle { 483 | if (UIStatusBarStyleBlackOpaque == statusBarStyle || 484 | UIStatusBarStyleBlackTranslucent == statusBarStyle || 485 | IS_IPAD) { 486 | 487 | [self setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"status-bar-pattern-black.jpg"]]]; 488 | self.textLabel.textColor = [UIColor whiteColor]; 489 | [self setProgressBackgroundColor:[UIColor colorWithRed:48/255.0f green:159/255.0f blue:211/255.0f alpha:1]]; 490 | [self.activityView setActivityIndicatorViewStyle:UIActivityIndicatorViewStyleWhite]; 491 | 492 | } else { 493 | [self setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"status-bar-pattern-default.jpg"]]]; 494 | self.textLabel.textColor = [UIColor colorWithRed:17/255.0f green:17/255.0f blue:17/255.0f alpha:1]; 495 | [self setProgressBackgroundColor:[UIColor colorWithRed:48/255.0f green:159/255.0f blue:211/255.0f alpha:1]]; 496 | [self.activityView setActivityIndicatorViewStyle:UIActivityIndicatorViewStyleGray]; 497 | } 498 | } 499 | 500 | 501 | //////////////////////////////////////////////////////////////////////////////////////////////////// 502 | - (void)showMessage:(NSString *)message 503 | withStatus:(BWStatusBarOverlayStatus)status 504 | duration:(NSTimeInterval)duration 505 | animated:(BOOL)animated { 506 | 507 | if (YES == self.hidden) { 508 | [self setMessage:message animated:NO]; 509 | [self initializeToDefaultState]; 510 | [self.activityView stopAnimating]; 511 | self.hidden = NO; 512 | 513 | if (animated) { 514 | [self animatateview:self.contentView show:YES completion:nil]; 515 | } 516 | } else { 517 | [self setMessage:message animated:animated]; 518 | [self showActivity:NO animated:animated]; 519 | [self fadeAnimatateview:_progressView show:NO completion:nil]; 520 | } 521 | 522 | [self performSelector:(animated) ? @selector(dismissAnimated) : @selector(hide) 523 | withObject:nil 524 | afterDelay:duration]; 525 | } 526 | 527 | 528 | //////////////////////////////////////////////////////////////////////////////////////////////////// 529 | - (void)rotateStatusBarAnimatedWithFrame:(NSValue *)frameValue { 530 | [UIView animateWithDuration:ROTATION_ANIMATION_DURATION animations:^{ 531 | self.alpha = 0; 532 | } completion:^(BOOL finished) { 533 | [self rotateStatusBarWithFrame:frameValue]; 534 | [UIView animateWithDuration:ROTATION_ANIMATION_DURATION animations:^{ 535 | self.alpha = 1; 536 | }]; 537 | }]; 538 | } 539 | 540 | 541 | //////////////////////////////////////////////////////////////////////////////////////////////////// 542 | - (void)rotateStatusBarWithFrame:(NSValue *)frameValue { 543 | CGRect frame = [frameValue CGRectValue]; 544 | UIInterfaceOrientation orientation = STATUS_BAR_ORIENTATION; 545 | 546 | if (UIDeviceOrientationPortrait == orientation) { 547 | self.transform = CGAffineTransformIdentity; 548 | } else if (UIDeviceOrientationPortraitUpsideDown == orientation) { 549 | self.transform = CGAffineTransformMakeRotation(M_PI); 550 | } else if (UIDeviceOrientationLandscapeRight == orientation) { 551 | self.transform = CGAffineTransformMakeRotation(M_PI * (-90.0f) / 180.0f); 552 | } else { 553 | self.transform = CGAffineTransformMakeRotation(M_PI * 90.0f / 180.0f); 554 | } 555 | 556 | self.frame = frame; 557 | [self setProgress:self.progress animated:NO]; 558 | } 559 | 560 | 561 | //////////////////////////////////////////////////////////////////////////////////////////////////// 562 | - (void)animatateview:(UIView *)view show:(BOOL)show completion:(BWStatusBarBasicBlock)completion { 563 | [self animatateview:view withAnimationType:self.animation show:show completion:completion]; 564 | } 565 | 566 | 567 | //////////////////////////////////////////////////////////////////////////////////////////////////// 568 | - (void)animatateview:(UIView *)view 569 | withAnimationType:(BWStatusBarOverlayAnimationType)animationType 570 | show:(BOOL)show 571 | completion:(BWStatusBarBasicBlock)completion { 572 | 573 | if (BWStatusBarOverlayAnimationTypeFade == animationType) { 574 | [self fadeAnimatateview:view show:show completion:completion]; 575 | 576 | } else if (BWStatusBarOverlayAnimationTypeFromTop == animationType) { 577 | [self fromTopAnimatateview:view show:show completion:completion]; 578 | 579 | } 580 | } 581 | 582 | 583 | //////////////////////////////////////////////////////////////////////////////////////////////////// 584 | - (void)fadeAnimatateview:(UIView *)view show:(BOOL)show completion:(BWStatusBarBasicBlock)completion { 585 | if (show) { 586 | view.alpha = 0; 587 | view.hidden = NO; 588 | } 589 | 590 | [UIView animateWithDuration:0.3 delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{ 591 | view.alpha = (show) ? 1 : 0; 592 | } completion:^(BOOL finished) { 593 | if (NO == show) { 594 | view.hidden = YES; 595 | view.alpha = 1; 596 | } 597 | 598 | if (nil != completion) 599 | completion(); 600 | }]; 601 | } 602 | 603 | 604 | //////////////////////////////////////////////////////////////////////////////////////////////////// 605 | - (void)fromTopAnimatateview:(UIView *)view show:(BOOL)show completion:(BWStatusBarBasicBlock)completion { 606 | __block CGRect frame = view.frame; 607 | CGFloat previousY = view.frame.origin.y; 608 | 609 | if (show) { 610 | view.hidden = NO; 611 | view.alpha = 0; 612 | frame.origin.y = -CGRectGetHeight(self.frame); 613 | view.frame = frame; 614 | } 615 | 616 | [UIView animateWithDuration:0.3 delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{ 617 | frame.origin.y += (show ? 1 : -1) * CGRectGetHeight(self.frame); 618 | view.frame = frame; 619 | view.alpha = (show) ? 1 : 0; 620 | } completion:^(BOOL finished) { 621 | if (NO == show) { 622 | frame.origin.y = previousY; 623 | view.frame = frame; 624 | view.hidden = YES; 625 | view.alpha = 1; 626 | } 627 | 628 | if (nil != completion) 629 | completion(); 630 | }]; 631 | } 632 | 633 | 634 | //////////////////////////////////////////////////////////////////////////////////////////////////// 635 | - (void)initializeToDefaultState { 636 | CGRect statusBarFrame = [UIApplication sharedApplication].statusBarFrame; 637 | [self rotateStatusBarWithFrame:[NSValue valueWithCGRect:statusBarFrame]]; 638 | [self setProgress:0]; 639 | _progressView.hidden = NO; 640 | 641 | [self setStatusBarStyle:[UIApplication sharedApplication].statusBarStyle animated:NO]; 642 | } 643 | 644 | 645 | @end 646 | --------------------------------------------------------------------------------