Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>maq is right. If you are using the scrolling transition, removing a child view controller from the UIPageViewController does not prevent the deleted "page" from returning on-screen if the user navigates to it. If you're interested, here's how I removed the child view controller from the UIPageViewController. </p> <pre><code>// deleteVC is a child view controller of the UIPageViewController [deleteVC willMoveToParentViewController:nil]; [deleteVC.view removeFromSuperview]; [deleteVC removeFromParentViewController]; </code></pre> <p>View controller deleteVC is removed from the childViewControllers property of the UIPageViewController, but still appears on-screen if the user navigates to it. </p> <p>Until someone smarter than me finds an elegant solution, here's a work around (it's a hack--so you have to ask yourself if you really need to remove pages from a UIPageViewController). </p> <p>These instructions assume that only one page is displayed at a time. </p> <p>After the user taps a button indicating that she would like to delete the page, navigate to the next or previous page using the setViewControllers:direction:animated:completion: method. Of course, you then need to delete the page's content from your data model. </p> <p>Next (and here's the hack), create and configure a brand new UIPageViewController and load it in the foreground (i.e., in front of the other UIPageViewController). Make sure that the new UIPageViewController starts off displaying the exact same page that was previously displayed. Your new UIPageViewController will fetch fresh view controllers from the data source. </p> <p>Finally, unload and destroy the UIPageViewController that's in the background. </p> <p>Anyway, maq asked a really good question. Unfortunately, I don't have enough reputation points to up vote the question. Ah, dare to dream... someday I will have 15 reputation points. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload