Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (IBAction)switchViews:(id)sender
- {
- UIViewAnimationTransition transition;
- UIViewController* switchTo;
- if (self.yellowViewController.view.superview == nil)
- {
- if (self.yellowViewController == nil)
- {
- self.yellowViewController = loadYellowViewController();
- }
- transition = UIViewAnimationTransitionFlipFromRight;
- switchTo = self.yellowViewController;
- }
- else
- {
- if (self.blueViewController == nil)
- {
- self.blueViewController = loadBlueViewController();
- }
- transition = UIViewAnimationTransitionFlipFromLeft;
- switchTo = self.blueViewController;
- }
- [UIView animateWithDuration:1.25
- delay:0.0
- options:UIViewAnimationCurveEaseInOut
- animations:^{
- [UIView setAnimationTransition:transition forView:self.view cache:YES];
- [self switchToViewController:switchTo];
- }
- completion:nil
- ];
- }
Add Comment
Please, Sign In to add comment