应用程序崩溃并显示错误消息:
由于未捕获的异常'NSInternalInconsistencyException'而终止应用程序,原因:'无效的参数不满足:[views count] == 3'
private func rotateFirstPage() {
guard let pageViewController = pageViewController else {
return
}
if let firstPage = pageDataSource.pages.first {
pageViewController.setViewControllers([firstPage], direction: .forward, animated: true, completion: nil)
}
}
func pageViewController(_ pageViewController: UIPageViewController,
didFinishAnimating finished: Bool,
previousViewControllers: [UIViewController],
transitionCompleted completed: Bool) {
if firstAutoRotation {
Timer?.invalidate()
rotateFirstPage()
}
pageControl.currentPage = pageDataSource.presentationIndex(for: pageViewController)
}