我无法修复此错误或找出此错误的原因,错误显示在下面的屏幕截图中. 只是尝试创建一个pageViewController的演示,我无法添加dataSource类,而self.dataSource = self. 提前致谢. 仅仅为自定义类添加
只是尝试创建一个pageViewController的演示,我无法添加dataSource类,而self.dataSource = self.
提前致谢.
仅仅为自定义类添加协议定义是不够的.您必须至少提供UIPageViewControllerDataSource协议的两个必需功能:func pageViewController(pageViewController: UIPageViewController, viewControllerBeforeViewController viewController: UIViewController) -> UIViewController? func pageViewController(pageViewController: UIPageViewController, viewControllerAfterViewController viewController: UIViewController) -> UIViewController?