Ios 从一个视图控制器到另一个视图控制器的向上卷曲和向下卷曲动画

Ios 从一个视图控制器到另一个视图控制器的向上卷曲和向下卷曲动画,ios,uiviewcontroller,uiviewanimationtransition,Ios,Uiviewcontroller,Uiviewanimationtransition,我尝试使用页面卷曲动画从一个视图控制器转到另一个视图控制器;但当我的第二个控制器加载时,它会对其隐藏集合视图。这是我的代码: OffersVC *Offers = [[OffersVC alloc]init]; Offers = [self.storyboard instantiateViewControllerWithIdentifier:@"Offers"]; [UIView beginAnimations:@"flipview" context:nil]; [UIV

我尝试使用页面卷曲动画从一个视图控制器转到另一个视图控制器;但当我的第二个控制器加载时,它会对其隐藏集合视图。这是我的代码:

OffersVC *Offers = [[OffersVC alloc]init];
    Offers = [self.storyboard instantiateViewControllerWithIdentifier:@"Offers"];
    [UIView beginAnimations:@"flipview" context:nil];
    [UIView setAnimationDuration:2];
    [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
    [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.view cache:YES];
    [self.view addSubview:Offers.view];

    [UIView commitAnimations];

尝试添加动画,如下所示并选中

  UIView *mainview = self.view.window;

OffersVC *Offers = [[OffersVC alloc]init];
Offers = [self.storyboard instantiateViewControllerWithIdentifier:@"Offers"];

[UIView transitionWithView:mainview
              duration:kAnimationViewTransition 
               options:UIViewAnimationOptionTransitionCurlUp
            animations:^{
                [self.navigationController.view removeFromSuperview];
                [mainview addSubview: offers.view];
            } 
            completion:^(BOOL finished) {
                [self presentModalViewController:offers animated:NO];
            }
];

而这个答案确实可以解决原来的问题。如果你能提供一些解释和背景,那将非常有帮助。