Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You can implement your own <code>UIViewController</code> as a splash screen:</p> <pre><code>@interface SplashScreenViewController : UIViewController { UIImageView *splashView; } @end </code></pre> <p>//</p> <pre><code>#import "SplashScreenViewController.h" @implementation SplashScreenViewController #pragma mark - View lifecycle - (void)loadView { self.view = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]]; splashView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)]; [splashView setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight]; [self.view addSubview:splashView]; } - (void)viewWillAppear:(BOOL)animated { if (isIPad) { if (UIInterfaceOrientationIsPortrait([[UIApplication sharedApplication] statusBarOrientation])) splashView.image = [UIImage imageNamed:@"Default-Portrait~ipad.png"]; else splashView.image = [UIImage imageNamed:@"Default-Landscape~ipad.png"]; } else splashView.image = [UIImage imageNamed:@"Default.png"]; } - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { if (isIPad) { if (UIInterfaceOrientationIsPortrait(toInterfaceOrientation)) splashView.image = [UIImage imageNamed:@"Default-Portrait~ipad.png"]; else splashView.image = [UIImage imageNamed:@"Default-Landscape~ipad.png"]; } } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (isIPad ? YES : UIInterfaceOrientationIsPortrait(interfaceOrientation)); } @end </code></pre> <p>Then, after showing, you can hide this <code>UIViewController</code> with any transition you want.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload