What is the proper procedure for removing a UIPageViewController from one of its child controllers?

I have a subclass UIPageViewControllerwith a bunch of subclasses UIViewControllercontained inside.

At some point in one of the subclasses UIViewController, if the user does something, I want to remove the entire system UIPageViewControllerin order to show only the basic preview, it was originally added.

I add a subclass UIPageViewControlleras the child view controller of my main view controller as follows:

ImageGalleryPageViewController *galleryPageViewController = [[ImageGalleryPageViewController alloc] initWithImagesAndCaptions:imagesAndCaptions];
[self addChildViewController:galleryPageViewController];
[self.view addSubview:galleryPageViewController.view];
[galleryPageViewController didMoveToParentViewController:self];

I am curious that it is best to remove it from the inside UIViewControllers.

My first reaction:

[self.imageGallery removeFromParentViewController];
[self.imageGallery.view removeFromSuperview];

(Where in my subclass UIViewControllerI have a link to the subclass UIPageViewControllerin which it is contained, and I say that the subclass UIPageViewControllershould be removed.

... ? , , UIPageViewController, UIViewController , , removeFromSuperview , .

UIPageViewController, ? - ?

, ? removeFromParentViewController view? ?

+3
1

, .: (

, :

UIPageViewController, ?

NSNotification.

0

All Articles