Reputation: 8384
I have set the "Launch Images" in Xcode that shows a "Loading..." screen when the iPhone app is being launched. And now, once the app starts, I want to show a slide out animation programmatically with the same image to reveal the app content underneath - very similar to what Dropbox for iPhone does. What's the easiest way to do this?
Upvotes: 3
Views: 3841
Reputation: 16864
Get the one navigation controller and that put into appdelgate.xib and which view after loading to display that class is set on them after into appdelegate.h file you create the object of the navigation controller and then after into appdelegate.m file following code to implement.
- (void)applicationDidFinishLaunching:(UIApplication *)application {
// Override point for customization after app launch
[window addSubview:viewController.view];
[self performSelector:@selector(nextDetail) withObject:nil afterDelay:2];
[window makeKeyAndVisible];
}
-(void)nextDetail{
[window addSubview:nxtVctr.view];
[self animationCode];
}
-(void)animationCode{
CGContextRef context = UIGraphicsGetCurrentContext();
[UIView beginAnimations:nil context:context];
[UIView setAnimationTransition: UIViewAnimationTransitionFlipFromLeft forView:self.window cache:YES];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationDuration:0.5];
[UIView commitAnimations];
}
Upvotes: 2
Reputation: 9132
In interface builder or in loadView, if you build your main view with code, add a UIImageView as a child of the main view, and set its frame to fill the whole screen. Make it the topmost view. Let's say you have an outlet to it called launchImageView.
In viewDidLoad
[UIView animateWithDuration:1.0
animations:^{
self.launchImageView.center = CGPointMake(self.launchImageView.center.x,
self.launchImageView.center.y + 480.0);
}
completion:^(BOOL finished){
[self.launchImageView removeFromSuperview];
self.launchImageView = nil;
}
];
Upvotes: 1