Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to dismiss UIPageViewController?

I added a UIPageViewController for instructions in my new game, and I want to dismiss the UIPageViewController after the user pressed the "GOT IT" button on the last UIViewController that connect to the UIPageViewController

I've tried this so far:

[self.pageVC dismissViewControllerAnimated:YES completion:nil];

And it doesn't remove the UIPageViewController, Why that?

And how can I dismiss it?

In order to show/present the UIPageViewController I do this:

[self addChildViewController:self.pageVC];
[self.view addSubview:self.pageVC.view];
[self.pageVC didMoveToParentViewController:self];

10x In advance!

like image 295
gran33 Avatar asked Jul 20 '14 09:07

gran33


1 Answers

Please try the opposite calls you have described:

[self.pageVC.view removeFromSuperview];
[self.pageVC removeFromParentViewController];
like image 140
Alex Peda Avatar answered Sep 22 '22 08:09

Alex Peda