Swift 2语法错误与方向.Forward
我在下一篇文章中写道:
self.pageViewController.setViewControllers(viewControllers as [AnyObject], direction: .Forward, animated: true, completion: nil)
但是现在,在Swift 2中它打印出下一个错误:
Could not find member 'Forward'
我该如何解决?
您应该确保您的viewControllers不是可选的Type。 如:
var viewControllers:[UIViewController] = [VC1,VC2] self.pageViewController.setViewControllers(viewControllers, direction: UIPageViewControllerNavigationDirection.Forward, animated: true, completion: nil)
- “CFNetwork SSLHandshake失败(-9807)”与“exception域”中的本地IP
- 团结检查互联网连接可用性
- 如何捕获MonoTouch中的UIWebView错误?
- iOS / watchos2 – 为什么不会话:didReceiveApplicationContext:火?
- 最好的“初始化”方法来设置iOS 7的variables值?
- 如何限制UIAlertView UITextField中的字符输入
- 我最喜欢的GIF应用功能:循环(iOS)
- 第一个和最后一个UITableViewCell在滚动时不断变化
- dyld:Library未加载:@ rpath / Alamofire.framework / Versions / A / Alamofire原因:找不到图像