Skip to content

Instantly share code, notes, and snippets.

@tranqy
Created April 28, 2009 11:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tranqy/103091 to your computer and use it in GitHub Desktop.
Save tranqy/103091 to your computer and use it in GitHub Desktop.
- (void) flipFromView:(UIViewController*)fromView toView:(UIViewController*)toView inDirection:(UIViewAnimationTransition)direction {
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1];
[UIView setAnimationTransition:direction forView:[fromView view] cache:YES];
[toView viewWillAppear:YES];
[fromView viewWillDisappear:YES];
[[fromView view] removeFromSuperview];
[window addSubview:[toView view]];
[toView viewDidAppear:YES];
[fromView viewDidDisappear:YES];
[UIView commitAnimations];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment