我的应用程序中有一个UIPageViewController,它充当不同UICollectionViewControllers的容器。每个UICollectionViewController代表一个新闻源,用户可以添加该新闻源,理想情况下,可以从UIPageViewController中删除该新闻源,并在不同的新闻源之间滑动。为了添加新闻源,用户点击+按钮,从新加载的视图中选择一个主题,然后返回时,UIPageViewController加载所有视图并按预期显示它。到现在为止还挺好。我现在想要实现的是,当用户点击“垃圾箱”按钮时,当前的可见视图将从UIPageViewController中移除,仅剩余的视图保留在UIPageViewController上。
我进行这项工作的唯一方法是通过按下垃圾桶按钮,加载新视图并返回到UIPageViewController,从ViewControllers数组中删除相应的ViewController。
因此,基本问题是:如何在UIPageViewController视图上从UIPageViewController中删除ViewController并重新加载UIPageViewController?
非常感谢任何帮助。
如评论中所述,请参阅此UIPageViewController以Scroll过渡样式导航到错误的页面
以正确的方式设置viewControllers。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句