I have code:
ListViewController * listViewController = [[ListViewController alloc] initWithNibName:@"ListViewController" bundle:nil];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.5];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.view cache:YES];
[self viewWillDisappear:YES];
[listViewController viewWillAppear:YES];
self.view.hidden = YES;
listViewController.view.hidden = NO;
[self viewDidDisappear:YES];
[listViewController viewDidAppear:YES];
[UIView commitAnimations];
But it does not works, and listViewController does not displayed( Please, somebody can tell me the solution of this problem?
Try something like:
As meronix said, non-block based animation is discouraged by Apple for the newer iOS versions. The above method is the “approved” way to do it.
Just so you know, the
viewWillAppear,viewDidDisappear, and similar methods aren’t methods that YOU call to make the view do things. They’re called automatically when these things happen.Your code had a few misunderstandings; I’ve commented on them below