Current App interface
func pageViewController(_ pageViewController: UIPageViewController, spineLocationFor orientation: UIInterfaceOrientation)
并返回
.mid
如果方向是水平的。然而,由于我没有使用
.pageCurl
.scroll
作为我的pageViewController的transitionStyle,从未调用过此方法。
Apple Documentation
不使用时也不能手动设置
. 苹果的文档说:
仅当过渡样式为pageCurl时,脊椎位置才有效。
我尝试添加一个方法,当方向为横向时调用该方法:
func showBothSides(){
let currentViewController = self.pageViewController!.viewControllers![0] as! PracticePageDataVC
let viewControllers: [UIViewController] = [currentViewController, currentViewController]
self.pageViewController!.setViewControllers(viewControllers, direction: .forward, animated: true, completion: {done in })
}
但这会返回错误:
“'提供的视图控制器数量(2)与请求的转换所需的数量(1)不匹配'”