Reputation: 32233
After setting up a PageViewController I'd like to remove the view controllers inside, leaving it empty.
How can I do this?
I've tried the setViewControllers:direction:animated:completion:
method passing nil
or an empty array in the viewControllers param but it crashes.
How can I do this?
Upvotes: 4
Views: 3019
Reputation: 195
-(UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerAfterViewController:(UIViewController *)viewController
{
return nil;
}
Upvotes: -1
Reputation: 19892
If calling setViewControllers:direction:animated:completion:
with nil
for the viewControllers
parameter crashes, try setting the view controllers to an array with a single empty view controller.
[pageViewController setViewControllers:@[UIViewController.new] direction:direction animated:true completion:nil];
Upvotes: 11