iPhone 5 Friendly Splash Screen Fadeout

Just add this code somewhere in your applicationDidBecomeActive function in your AppDelegate and viola!

{syntaxhighlighter brush: csharp;fontsize: 100; first-line: 1; }UIImageView *splash;
splash = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@”Default-568h.png”]];
splash = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@”Default.png”]];

[self.window.rootViewController.view addSubview:splash];

[UIView animateWithDuration:0.5
splash.alpha = 0;
completion:^(BOOL finished) {
[splash removeFromSuperview];

YOU NEED TO DEFINE IPHONE_5 FIRST! I do so in my .pch, but you can do this anywhere and it looks like:

{syntaxhighlighter brush: csharp;fontsize: 100; first-line: 1; }#define IS_IPHONE_5 ( fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height – ( double )568 ) < DBL_EPSILON ){/syntaxhighlighter}

Leave a comment

Your email address will not be published. Required fields are marked *