"Cannot invoke" 'setViewController' with an argument list of type '([AnyObject], direction: UIPageViewControllerNavigationDirection, animated: Bool, completion: nil)'"
I got this error in Xcode 7 beta 3 at this line of code:
self.pageViewController.setViewControllers(viewControllers as [AnyObject], direction: UIPageViewControllerNavigationDirection.Forward, animated: true, completion: nil)
This is the rest of the code:
pageImages = NSArray(objects:"screenshot01","screenshot02","screenshot03")
self.pageViewController = self.storyboard?.instantiateViewControllerWithIdentifier("MyPageViewController") as! UIPageViewController
self.pageViewController.dataSource = self
var initialContenViewController = self.pageTutorialAtIndex(0) as TutorialPageContentHolderViewController
var viewControllers = NSArray(object: initialContenViewController)
self.pageViewController.setViewControllers(viewControllers as [AnyObject], direction: UIPageViewControllerNavigationDirection.Forward, animated: true, completion: nil)
self.pageViewController.view.frame = CGRectMake(0, 100, self.view.frame.size.width, self.view.frame.size.height-100)
self.addChildViewController(self.pageViewController)
self.view.addSubview(self.pageViewController.view)
self.pageViewController.didMoveToParentViewController(self)
I don't get the error if I run the same code in Xcode 6 and I can't figure out why.