-
-
Save Shereef/4cefe1053e2691eb3ca4 to your computer and use it in GitHub Desktop.
Challenge 1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface XYZWaitController : UIViewController | |
@property (strong, nonatomic) UILabel *alert; | |
@end | |
@implementation XYZWaitController | |
- (void)viewDidLoad | |
{ | |
CGRect frame = CGRectMake(20, 200, 200, 20); | |
self.alert = [[UILabel alloc] initWithFrame:frame]; | |
self.alert.text = @"Please wait 10 seconds..."; | |
self.alert.textColor = [UIColor whiteColor]; | |
[self.view addSubview:self.alert]; | |
NSOperationQueue *waitQueue = [[NSOperationQueue alloc] init]; | |
[waitQueue addOperationWithBlock:^{ | |
[NSThread sleepUntilDate:[NSDate dateWithTimeIntervalSinceNow:10]]; | |
self.alert.text = @"Thanks!"; | |
}]; | |
} | |
@end | |
@implementation XYZAppDelegate | |
- (BOOL)application:(UIApplication *)application | |
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
{ | |
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; | |
self.window.rootViewController = [[XYZWaitController alloc] init]; | |
[self.window makeKeyAndVisible]; | |
return YES; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment