title: Autolayout and AVPlayerViewController
body: <p>I am adding a AVPlayerViewController instance to a UIView. The UIView is initialized through the storyboard. I set the top constraint to the top layout and the bottom constraint to the bottom layout. When the app is compiled, the view is the right size but shifted 64px down (height of top nav bar). How do I solve this? Setting top constraint to 64 solves the problem for a bit, until I go back in the views and then it still becomes misaligned. </p>
  
  <pre><code>//AVPlayer object can direct its visual output to AVPlayer. AVPlayerVC is a AVPlayerViewController. You can add it via objects in bottom-right corner.
  AVPlayerViewController *avPlayerVC=[[AVPlayerViewController alloc] init];
  avPlayerVC.player=self.avPlayer;
  
  [self addChildViewController:self.avPlayerVC];
  [self.playerView addSubview:self.avPlayerVC.view];
  self.avPlayerVC.view.frame = self.playerView.frame;
  
  [avPlayerVC didMoveToParentViewController:self];
  
  DLog(@"%@",NSStringFromCGRect(avPlayerVC.view.frame));
  DLog(@"%@",NSStringFromCGRect(self.playerView.frame));
  DLog(@"%@",NSStringFromCGRect(self.view.frame));
  
  [self.avPlayerVC.player play];
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/kSOzK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kSOzK.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/mefsF.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mefsF.jpg" alt="enter image description here"></a></p>
  
  <p>Log: </p>
  
  <pre><code>[Line 95] {{0, 0}, {100, 100}}
  [Line 97] {{0, 64}, {375, 554}}
  [Line 99] {{0, 0}, {375, 667}}
  </code></pre>