Skip to content

Instantly share code, notes, and snippets.

@engincancan
Created December 27, 2019 11:58
Show Gist options
  • Save engincancan/b34aeeefc7d15ea1e13387b1fb020c7c to your computer and use it in GitHub Desktop.
Save engincancan/b34aeeefc7d15ea1e13387b1fb020c7c to your computer and use it in GitHub Desktop.
@interface MyCustomController : UIViewController
@property (strong, nonatomic) UILabel *alert;
@end
@implementation MyCustomController
- (void)viewDidLoad {
CGRect frame = CGRectMake(100, 100, 100, 50);
self.alert = [[UILabel alloc] initWithFrame:frame];
self.alert.text = @"Please wait...";
[self.view addSubview:self.alert];
dispatch_async(
dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0),
^{
sleep(10);
self.alert.text = @"Waiting over";
}
);
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment