title: Can't Add Autolayout Constraints To UIPageViewController
body: <p>I have a UIView with a container, in that container I have a UIPageViewController that will have views you can swipe through, similar to Apple's Stocks app on the iPhone.</p>
  
  <p>I'm trying to go all Autolayout with this, but the UIPageViewController won't let me add Autolayout constraints.</p>
  
  <p>The last line of the following code gets a "No visible @interface for 'UIPageViewController' declares the selector 'addConstraints'.</p>
  
  <pre><code>NSDictionary *viewsDictionary = NSDictionaryOfVariableBindings(self.con_pageViewController);
  NSArray *constraints = [NSLayoutConstraint constraintsWithVisualFormat:@"[conPageViewController]"
                                                                 options:NSLayoutFormatAlignAllBaseline
                                                                 metrics:nil
                                                                   views:viewsDictionary];
  [self.pageViewControllerPortrait addConstraints:constraints];
  </code></pre>
  
  <p>However if I don't set something the UIPageViewController takes over the whole page as seen in the following image. The whole view has an aqua background, the container a pink background, the UIPageViewController has an orange background, (set in code), and the view that I want to display in the UIPageViewController is tan, (I think). </p>
  
  <p>As you can see, the UIPageViewController takes the whole view, with the view it is meant to show following.</p>
  
  <p><img src="https://i.stack.imgur.com/sSAQd.png" alt="enter image description here"></p>
  
  <p>If I set the UIPageViewController's frame to the size of its container it looks like the following. I feel like if I can't add constraints to UIPageViewController that this way would be best for the long term.</p>
  
  <pre><code>self.pageViewControllerPortrait.view.frame = self.con_pageViewController.frame;
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/bV36h.png" alt="enter image description here"></p>
  
  <p>If I hardcode the frame of UIPageViewController I can get the size I want, however what I don't understand is that the container is 220px, but I need to set the UIPageViewController to a height of 284px for it to fill the container.</p>
  
  <pre><code>self.pageViewControllerPortrait.view.frame = CGRectMake(0, 0, 320, 284);
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/mUmM6.png" alt="enter image description here"></p>
  
  <p>If anyone could explain what is going on here It would be greatly appreciated.</p>
  
  <p>How this looks in Interface Builder incase it helps.</p>
  
  <p><img src="https://i.stack.imgur.com/W86iP.png" alt="enter image description here"></p>