Swift 2语法错误与方向.Forward

时间:2015-09-14 11:52:31

标签: ios swift syntax-error swift2

我在下一篇的Swift 1.2中写道:

{{1}}

但是现在,在Swift 2中它打印出下一个错误:

{{1}}

我该如何解决?

1 个答案:

答案 0 :(得分:9)

您应该确保您的viewControllers不是可选的Type。如:

var viewControllers:[UIViewController] = [VC1,VC2]
self.pageViewController.setViewControllers(viewControllers, direction: UIPageViewControllerNavigationDirection.Forward, animated: true, completion: nil)