以编程方式/代码设置过渡到部分卷曲

bha*_*ari 2 objective-c ios

在StoryBoard中,我们可以在视觉上设置如下

在此输入图像描述

我们怎么能用.Xib/nib文件做同样的事情?

[self presentViewController:self.infoController animated:YES completion:nil];
Run Code Online (Sandbox Code Playgroud)

上面的代码只是使用模态样式,但如何将过渡样式设置为Partial Curl.

Dil*_*lip 6

您可以使用以下代码执行此操作:

    #import "InfoController.h"

   - (IBAction)goToSecond:(id)sender { 
         InfoController *vc = [[InfoController alloc] initWithNibName:@"InfoController" bundle:nil];
         vc.modalTransitionStyle = UIModalTransitionStylePartialCurl;
         [self presentViewController:vc animated:YES completion:^{
           //completion code here
         }];
     }
Run Code Online (Sandbox Code Playgroud)