Pregunta

I have a UIPageViewController in my app that serves as a container for different UICollectionViewControllers. Every UICollectionViewController represents a newsfeed that a user can add and ideally remove from the UIPageViewController and swipe between the different newsfeeds. For adding a newsfeed, the user taps on a + button, picks a topic from the newly loaded view, and when returning back, the UIPageViewController loaded all views and presents it as expected. So far so good. What I now want to achieve is that when a user taps the trash button, the current visible view is removed from UIPageViewController and only the remaining ones are left while still being on UIPageViewController.

The only way for me to make this work is to remove the corresponding ViewController from the array of ViewControllers by pressing the trash button , load a new view, and returning back to the UIPageViewController.

So the basic question is: How can I remove a ViewController from my UIPageViewController and reload the UIPageViewController while on UIPageViewController view?

Any help is much much appreciated.

¿Fue útil?

Solución

As mentioned in the comments, see this UIPageViewController navigates to wrong page with Scroll transition style

Set viewControllers in the right way.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top