iOS - programmatic modal segue with animation (suc

2019-04-10 17:24发布

问题:

I know I can do a modal segue in code like this:

[presentModalViewController:my_view, animated:YES];

but how do I specify a fade in or horizontal/vertical flip programmatically?

Thanks, Pachun

回答1:

set this property to your viewController: modalTransitionStyle

UIModalTransitionStyle from apple doc

  typedef enum { UIModalTransitionStyleCoverVertical = 0, 
                 UIModalTransitionStyleFlipHorizontal,
                 UIModalTransitionStyleCrossDissolve,  
                  UIModalTransitionStylePartialCurl,} UIModalTransitionStyle;