I'm having trouble with an error while implementing a UIPageViewController in Swift.
There is my code:
var pageViewController: UIPageViewController? = nil
let pageTitles = ["One", "Two", "Three"]
override func viewDidLoad() {
super.viewDidLoad()
pageViewController = self.storyboard!.instantiateViewControllerWithIdentifier("PageViewController") as? UIPageViewController
pageViewController!.dataSource = self;
let startingViewController = viewControllerAtIndex(0);
let viewControllers = [startingViewController]
pageViewController!.setViewControllers(viewControllers, direction: UIPageViewControllerNavigationDirection.Forward, animated: false, completion: nil)
}At line 14 I get this error:
Cannot invoke 'setViewControllers' with an argoument list of type '([PageContentViewController?], direction UIPageViewControllerNavigationDirection, animated: Bool, completion: nil)'
Well, I think this is related to unwrap the property I declared at line 2 but I don't know how to do it
Can someone help me?
Thank you