Skip to content

Instantly share code, notes, and snippets.

@albertodebortoli
Created March 9, 2012 22:16
Show Gist options
  • Save albertodebortoli/2009007 to your computer and use it in GitHub Desktop.
Save albertodebortoli/2009007 to your computer and use it in GitHub Desktop.
iPhone splash screen fade out animation
// in application:didFinishLaunchingWithOptions: in app delegate
// before [window makeKeyAndVisible];
UIImageView *splashView = [[UIImageView alloc] initWithFrame:CGRectMake(0,0, 320, 480)];
splashView.image = [UIImage imageNamed:@"background.png"];
// after [window makeKeyAndVisible];
splashView = [[UIImageView alloc] initWithFrame:CGRectMake(0,0, 320, 480)];
splashView.image = [UIImage imageNamed:@"Default.png"];
[window addSubview:splashView];
[window bringSubviewToFront:splashView];
[UIView animateWithDuration:0.5 animations:^{
[splashView setAlpha:0.0];
} completion:^(BOOL finished) {
[splashView removeFromSuperview];
}];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment