0

I have a simple controller with a container, I want to use UIPageViewController inside this container however I have a small problem with auto-layout on my child VC. Here is my storyboard, I have a single label in my left VC which is at the center of the view. enter image description here

When I set an embed segue from my container to my left VC I have no issue with label position : enter image description here

However when I set my embed segue to my EndGamePageViewController which is supposed to present my left VC I have this issue with auto-layout :

enter image description here

I have already look at other relative questions such as this one, but this does not change anything, I have also tried to add

self.view.setNeedsLayout()
self.view.setNeedsUpdateConstraints()

in the viewDidLoad of my left VC but this does not work, if anyone can help me figure this out, this would be great. Thanks.

Community
  • 1
  • 1
Chajmz
  • 729
  • 5
  • 11
  • where is `EndGamePageViewController` view in storyboard ? – Shubhank Jun 21 '16 at 14:57
  • Hmm I'm not sure to understand, the `EndGamePageViewController` is a subclass of `UIPageViewController` on the right in my storyboard, it's a simple pageviewcontroller which display only twice my left VC. – Chajmz Jun 21 '16 at 15:03
  • do you have any constraints setup for its view ? – Shubhank Jun 21 '16 at 15:19
  • This controller has nothing inside, just the delegate function for the `UIPageViewControllerDataSource` and `UIPageViewControllerDelegate`, it's only used to display my left VC which contains the label centered. You can see that it does not have a `UIView` or something else. – Chajmz Jun 21 '16 at 15:30

0 Answers0