【发布时间】:2014-10-11 13:29:51
【问题描述】:
在我的应用程序的 ViewController 中,我调用了 transitionFromViewController 但在将闭包传递给完成时总是出现以下错误:参数。
Type '() -> Void' does not conform to protocol 'NilLiteralConvertible'
这是函数调用:
self.transitionFromViewController(
self.currentVC,
toViewController: newController,
duration: 0.2,
options: UIViewAnimationOptions.TransitionCrossDissolve,
nil,
completion: { finished in
fromViewController.removeFromParentViewController()
toViewController.didMoveToParentViewController(containerViewController)
toViewController.view.frame = containerViewController.view.bounds
})
根据代码完成,方法签名如下:
transitionFromViewController(fromViewController: UIViewController, toViewController: UIViewController, duration: NSTimeInterval, options: UIViewAnimationOptions, animations: () -> Void(), completion: ((Bool) -> Void)?)
【问题讨论】:
标签: ios uiviewcontroller swift