Malloc
Malloc

Reputation: 16296

make a flip animation when navigating from view to view

please i have problem in making flip animation when going from a view to another, i explain : i have found a tutorial in this url : http://www.youtube.com/watch?v=Rgnt3auoNw0 which explain me how to do, however the method of adding views in this tutorials and mine wasn`t the same, although i tried to put the code that he used in my IBAction so my IBAction looks like that :

-(IBAction)goToRechercherView{
[UIView beginAnimations:@"flipview" context:nil]; 
[UIView setAnimationDuration:2];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft
                       forView:self.view cache:YES];
[self presentModalViewController:rechercherViewController animated:YES];
[UIView commitAnimations];
} 

like that my app build succesfully but there is no transition when i navigate from my view where i have puted the iBAction, please help, thx in advance :)

Upvotes: 2

Views: 4581

Answers (3)

Radix
Radix

Reputation: 3657

This worked for me

 Yourviewcontroller *obj = [[Yourviewcontroller alloc]init];

    obj.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
     [self presentModalViewController:obj animated:YES];

Upvotes: 1

Dancreek
Dancreek

Reputation: 9544

One thing that will help is to change animated: to NO on the presentModalViewController: line. I just ran into this yesterday in a similar scenario. You are basically asking the OS to animate something that is already being asked to animate. This should help.

Upvotes: 2

adamweeks
adamweeks

Reputation: 1332

You shouldn't need any of the animation code. Simply do this before the presentModalViewController:

rechercherViewController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;

Upvotes: 7

Related Questions