Skip to content

Instantly share code, notes, and snippets.

@ppave
Forked from albertodebortoli/AppDelegate.m
Created June 4, 2022 17:38
Show Gist options
  • Save ppave/2608222e3ff34d4f3566430ebd47b27b to your computer and use it in GitHub Desktop.
Save ppave/2608222e3ff34d4f3566430ebd47b27b 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