2

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.

Oliver Schobel
  • 377
  • 4
  • 20
  • Try this http://stackoverflow.com/questions/12939280/uipageviewcontroller-navigates-to-wrong-page-with-scroll-transition-style/12939384#12939384 – Samkit Jain Feb 13 '14 at 13:53
  • Yeah, that's actually it. I came across this question before, but used the presented code the wrong way. Instead of giving `setViewControllers` one single ViewController, I passed it an array of many ViewControllers. After correcting this, it does exactly what I want. Thanks Samkit. – Oliver Schobel Feb 13 '14 at 16:41
  • Ok..please vote up my answer i m writing one – Samkit Jain Feb 13 '14 at 18:37

1 Answers1

-1

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

Set viewControllers in the right way.

Community
  • 1
  • 1
Samkit Jain
  • 2,523
  • 16
  • 33