title: Embedded UIPageController child VC has wrong frame origin
body: <p>I am trying to create a layout element like below in the middle of a page and leverage <code>UIPageViewController</code> to do it.</p>
  
  <p><a href="https://i.stack.imgur.com/fKcO1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fKcO1.png" alt="Desired layout"></a></p>
  
  <p>I embedded a <code>UIPageViewController</code> in a container view. The contents of the card element have a height determined by AutoLayout, and stretch horizontally towards the margins, with the card having a max width after which it stays centered.  However I'm running into a strange problem. When I set the VC for the card element to be the contents of my <code>UIPageViewController</code>, the individual page gets mostly sized correctly, but its origin is outside the bounds of the pageVC's content view. </p>
  
  <p>I recreated the problem in a very small test project. Here is the storyboard and relevant constraints:</p>
  
  <p><a href="https://i.stack.imgur.com/FF8hT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FF8hT.png" alt="enter image description here"></a></p>
  
  <p>Here is my code:</p>
  
  <pre><code>class ViewController: UIViewController {
  
      var pageController: UIPageViewController!
  
      override func viewDidLoad() {
          super.viewDidLoad()
          guard let vc = storyboard?.instantiateViewController(withIdentifier: "PageView") else { return }
          pageController.setViewControllers([vc], direction: .forward, animated: true, completion: nil)
      }
  
      override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
          if let dest = segue.destination as? UIPageViewController {
              pageController = dest
          }
      }
  
  }
  
  class SinglePageViewController: UIViewController {
  
      override func viewDidLoad() {
          super.viewDidLoad()
          view.translatesAutoresizingMaskIntoConstraints = false
      }
  
  }
  </code></pre>
  
  <p>And here is what I am actually getting:</p>
  
  <p><a href="https://i.stack.imgur.com/XUPIr.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XUPIr.jpg" alt="enter image description here"></a></p>
  
  <p>I tried setting <code>view.autoresizingMask = [.flexibleWidth, .flexibleLeftMargin, .flexibleRightMargin]</code> instead of <code>view.translatesAutoresizingMaskIntoConstraints = false</code> in <code>SinglePageViewController</code>, and that gives it correct leading, trailing, and width constraints, but then I can't get the <code>UIView-Encapsulated-Layout-Height: self.height = 0</code> constraint to go away. There are no system constraints that account for the origin misplacement, so I have no idea how to debug further. All the views higher up in the hierarchy have height 0, and all the views farther down are placed correctly. If I embed the <code>SinglePageViewController</code> directly in the container view, it lays out perfectly, but if I put the <code>UIPageViewController</code> in between, it breaks. </p>
  
  <p>Why doesn't the <code>UIPageViewController</code> constrain the pages inside it to match its view's bounds? Is there any way to get this to work?</p>