How do I create a UIPageviewcontroller in a container using iOS Objective C?

I created a UIPageviewcontroller Inside a container with two sub view controllers for page navigation. Now problem I have set limits for container on mainviewcontroller as below

enter image description here

Problem: You need to control the container. its showing the top side and hiding the top bar and terrain and not seeding it. I am creating a container on a base view. the base view has good constraints.

+1


source to share


1 answer


For the above, we need to set as shown below



// Add the page view controller to this root view controller.
[self addChildViewController:self.pageViewController];
self.pageViewController.view.frame = self.containerView.frame;
[self.containerView addSubview:self.pageViewController.view];
[self.pageViewController didMoveToParentViewController:self];

      

0


source







All Articles