Skip to content

Instantly share code, notes, and snippets.

@bmeurer
Created June 15, 2011 03:51
Show Gist options
  • Star 14 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save bmeurer/1026439 to your computer and use it in GitHub Desktop.
Save bmeurer/1026439 to your computer and use it in GitHub Desktop.
Nice transition from splash screen to main application screen using fade out and zoom in animation. Change the -application:didFinishLaunchingWithOptions: method of your application delegate class like this (assuming your splash image is named Default.png
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Put necessary initialization steps here...
// Add imageView overlay with fade out and zoom in animation
UIImageView *imageView = [[UIImageView alloc] initWithFrame:self.window.frame];
imageView.image = [UIImage imageNamed:@"Default"]; // assuming your splash image is "Default.png" or "Default@2x.png"
[self.window addSubview:imageView];
[self.window bringSubviewToFront:imageView];
[UIView transitionWithView:self.window
duration:0.75f
options:UIViewAnimationOptionTransitionNone
animations:^(void){
imageView.alpha = 0.0f;
imageView.frame = CGRectInset(imageView.frame, -100.0f, -100.0f);
}
completion:^(BOOL finished){
[imageView removeFromSuperview];
}];
[imageView release];
[self.window makeKeyAndVisible];
return YES;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment