我知道有四种类型的UIModalTransitionStyle
s,但我不想使用其中任何一种。
但是,此代码不起作用:
@IBAction func button(sender: AnyObject) {
let modalView = ViewController()
let storyboard = UIStoryboard(name: "Universal", bundle: nil)
let vc = storyboard.instantiateViewControllerWithIdentifier("ViewController") as UIViewController
modalView.modalTransitionStyle = nil // Error: type 'UIModalTransitionStyle' does not conform to protocol 'NilLiteralConvertible'
self.presentViewController(vc, animated: true, completion: nil)
}
每当我不指定 时modalTransitionStyle
,编译器都会modalTransitionStyle
从 Storyboard 文档中获取UIViewController
.
如何设置 no modalTransitionStyle
?