Created
June 15, 2011 03:51
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (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 "[email protected]" | |
[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