Appgix Appgix - 6 months ago 25
iOS Question

How delete Pages in UIPageViewController?

Is it possible to delete multiple or all pages in the

UIPageViewController
?

In my situation I navigate back to the
UIPageViewController
after deleting some pages/entries and I want to set only one already created Page.

I can't create all pages and save their references because of the big number of pages.

Answer

There is nothing to delete. A UIPageViewController doesn't have any pages other than the one whose view is showing right now. It merely calls its data source asking for the next or previous page. If you don't want the user to be able to navigate to any other pages, don't supply a next or previous page: return nil from those data source methods.