Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- +(void) showSplashScreen
- {
- UIView *mainScreen = [[[UIApplication sharedApplication]delegate]window];
- UIView *windowBlocker = [[UIView alloc]initWithFrame:mainScreen.frame];
- windowBlocker.tag = 999;
- windowBlocker.backgroundColor = [UIColor clearColor];
- UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake((mainScreen.frame.size.width), (mainScreen.frame.size.height), 50, 50)];
- imageView.layer.backgroundColor=[[UIColor colorWithRed:200 green:0 blue:0 alpha:0.5] CGColor];
- imageView.layer.cornerRadius=10;
- imageView.layer.masksToBounds = YES;
- [windowBlocker addSubview:imageView];
- UIActivityIndicatorView *spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
- [windowBlocker addSubview:spinner];
- spinner.center = mainScreen.center;
- [spinner startAnimating];
- }
- -(void)viewWillAppear:(BOOL)animated {
- [super viewWillAppear:animated];
- [self performSelector:@selector(addSplash) withObject:nil afterDelay:0.5];
- }
- -(void)addSplash {
- [[self class] showSplashScreen];
- }
- +(void) showSplashScreen
- {
- UIView *mainScreen = [[[UIApplication sharedApplication]delegate]window];
- UIView *windowBlocker = [[UIView alloc]initWithFrame:mainScreen.frame];
- windowBlocker.tag = 999;
- windowBlocker.backgroundColor = [UIColor redColor];
- UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake((mainScreen.frame.size.width), (mainScreen.frame.size.height), 50, 50)];
- imageView.layer.backgroundColor=[[UIColor colorWithRed:200 green:0 blue:0 alpha:0.5] CGColor];
- imageView.layer.cornerRadius=10;
- imageView.layer.masksToBounds = YES;
- [windowBlocker addSubview:imageView];
- UIActivityIndicatorView *spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
- [windowBlocker addSubview:spinner];
- spinner.center = mainScreen.center;
- [spinner startAnimating];
- [[[[UIApplication sharedApplication]delegate]window] addSubview:windowBlocker];
- }
- -(void)viewDidAppear:(BOOL)animated {
- [super viewDidAppear:animated];
- [[self class] showSplashScreen];
- }
- UIActivityIndicatorView *spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
- [imageView addSubview:spinner];
- spinner.center = mainScreen.center;
- [windowBlocker addSubview:imageView];
- [self.view addSubview: mainScreen];
- [spinner startAnimating];
- [Self.view addSubview:windowBlocker];
- UIActivityIndicatorView *spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
- spinner.center = mainScreen.center;
- [spinner startAnimating];
- [windowBlocker addSubview:spinner];
- [mainScreen addSubview:windowBlocker];
- UIActivityIndicatorView *spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
- spinner.color=[UIColor greenColor];
- spinner.center = self.view.center;
- [spinner startAnimating];
- [windowBlocker addSubview:spinner];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement