我正在使用UIPageViewController,其Next按钮具有相同的功能,例如轻扫到下一个视图。
@IBAction func next(sender: UIButton!) {
let pageContentViewController = pageViewController.viewControllers![0] as! WelcomeViewController
let index = pageContentViewController.pageIndex + 1
if index < titleArray.count {
let vctoMove = self.viewControllerAtIndex(index) as WelcomeViewController
let viewControllers = NSArray(objects: vctoMove)
pageViewController.setViewControllers(viewControllers as? [UIViewController], direction: .Forward, animated: true, completion: nil)
}
}