I have an info button on FirstViewControlle.xib. When I click on it, I’m going to info.xib.

-(IBAction)info //кнопка перехода на info.xib { InfoViewController *ivc = [[InfoViewController alloc]initWithNibName:@"InfoViewController" bundle:nil]; UIBarButtonItem *backBtn2 = [[UIBarButtonItem alloc]initWithTitle:@"to first" style:UIBarButtonItemStyleBordered target:nil action:nil]; [[self navigationItem]setBackBarButtonItem:backBtn2]; //переход [UIView beginAnimations:nil context:NULL]; [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; [UIView setAnimationDuration:1.0]; [self.navigationController pushViewController:ivc animated:NO]; [UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:self.navigationController.view cache:NO]; [UIView commitAnimations]; } 

    1 answer 1

    First, get rid of the old syntax; for a long time, methods like

     [UIView transitionFromView:fView toView:tView duration:deration options:UIViewAnimationCurveEaseInOut completion:^(BOOL finished) {}]; 

    or

     [UIView animateWithDuration:duration delay:0.0 options:UIViewAnimationOptionCurveEaseOut animations:^{ /* do your animations here */ }completion:^(BOOL finished) {}]; 

    recommended by Apple as a replacement for the UIView +beginAnimations:context: +commitAnimations after the introduction of blocks

    secondly, for implementing custom transitions in UINavigationController there is a recommended technique through UIViewControllerAnimatedTransitioning + UIViewControllerTransitioningDelegate

    Here is a description with examples:

    a very powerful tool that supports push and pop view controller, respectively, your task can be solved with this tool, also there is available persent driven transition, so that the user can guide with his finger and at the same time see the custom animation in the process.

    if you don't want to bother with all this, you can try:

     [UIView beginAnimations:nil context:NULL]; [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; [UIView setAnimationDuration:1.0]; [self.navigationController popViewControllerAnimated:NO]; [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.navigationController.view cache:NO]; [UIView commitAnimations];