0

I must change a view. In a view I've a button with this code:

    FormazioneViewController *formazioneC = [[FormazioneViewController alloc] initWithNibName:@"FormazioneView" bundle:nil];

self.formazioneViewController= formazioneC;

[UIView beginAnimations:@"View Flip" context:nil];
[UIView setAnimationDuration:1.25];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(animationDidStop)];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];

[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.view cache:YES];

[self viewWillDisappear:YES];
[self viewDidDisappear:YES];
[self.view addSubview:formazioneViewController.view];
[formazioneViewController viewWillAppear:YES];
[formazioneViewController viewDidAppear:YES];

[UIView commitAnimations];

and I add a superview, now i must return in this view and i use a button with this code:

    [UIView beginAnimations:@"View Flip" context:nil];
[UIView setAnimationDuration:1.25];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(animationDidStop)];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.view cache:YES];

[self viewWillDisappear:YES];
[self viewDidDisappear:YES];

[self.view removeFromSuperview];

[****** viewWillAppear:YES];
[****** viewDidAppear:YES];

[UIView commitAnimations];

What is the object where i must call the viewWillAppear and ViewDidAppear method?? Thanks

Sorry for my bad english!

Pfitz
  • 7,336
  • 4
  • 38
  • 51

1 Answers1

0

Have you Written this method,

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
{
    return YES;
}
Krunal
  • 6,440
  • 21
  • 91
  • 155
  • also write this `[UIView setAnimationBeginsFromCurrentState:YES];` – Krunal Jun 13 '12 at 09:44
  • where I must add this? in the botton method?? – Andrea Barbieri Jun 13 '12 at 09:50
  • after this line `[UIView setAnimationDuration:1.25];` and where you want animation write this line. – Krunal Jun 13 '12 at 09:53
  • where is `animationDidStop` method ? – Krunal Jun 13 '12 at 09:53
  • there isn't the method animationDidStop! – Andrea Barbieri Jun 13 '12 at 12:27
  • what you want ? i am not getting your question. *i thought you want to navigate to a new page with animation* – Krunal Jun 14 '12 at 04:27
  • I've 2 view with two nib file! I must switch the view with animation. When I press the first botton the animation work and I see the second view, but when i click the button in the second view the animation doesn't work because I've not the object for call the method viewWillAppear:YES and ViewDidAppear:YES – Andrea Barbieri Jun 14 '12 at 12:31
  • inside your second view, when you click button inside button click method write: `[self.navigationController popViewControllerAnimated:YES];` – Krunal Jun 15 '12 at 11:30