title: UIViewController doesn't update view's constraints when the device orientation is changing
body: <p>I'm making an app where the iPad can be used in both landscape and portrait mode. 
  The configuration of my UIViewControllers is the following : </p>
  
  <p>I have a <code>UIViewController</code> with a <code>UICollectionView</code> which has the following constraints : <strong>top, leading, trailing, and bottom</strong> set to <strong>0</strong> with its superview (the superview is the <code>UIView</code> of my <code>UIViewController</code>). </p>
  
  <p>When I tap a cell, I push another <code>UIViewController</code> in the <code>UINavigationController</code> which is a detail viewController of the cell. Simple.</p>
  
  <p>When I change the device orientation in the <strong>first</strong> view controller, the <code>UICollectionView</code> bounds are set properly. </p>
  
  <p>Here come my <strong>problem</strong> : </p>
  
  <p>If I select a cell in the <code>UICollectionView</code>, the second detail viewController is displayed. Then if in this second ViewController I change the device orientation and then I go back into the first viewController, the  view of my <code>UIViewController</code> hasn't been rotated. I don't know why, I tried this without success : </p>
  
  <p><code>self.view.layoutIfNeeded()</code> in <code>viewDidAppear()</code> of my firstViewController to update constraints according the current orientation, it didn't work. This didn't work because I noticed one thing :</p>
  
  <p>The frame view of my first viewController is still the same as the previous orientation, it didn't change... But if I rotate again the device, the <code>UIViewController</code> detect the orientation changes, and the view bounds are set properly.</p>
  
  <p>So my problem is : when I'm in the second view controller, and that I'm rotating the device, and then that I go back in the previous view controller, the previous controller hasn't detected the orientation change I just made in the second view controller.</p>
  
  <p>GIF Demo : </p>
  
  <p><a href="https://i.stack.imgur.com/Jtxcx.gif" rel="noreferrer"><img src="https://i.stack.imgur.com/Jtxcx.gif" alt="enter image description here"></a></p>
  
  <p>After that I made a rotation from portrait to landscape mode, the <strong>view</strong> <strong>is not</strong> changed as the debug view hierarchy tool shows below : </p>
  
  <p><a href="https://i.stack.imgur.com/GkGSN.png" rel="noreferrer"><img src="https://i.stack.imgur.com/GkGSN.png" alt="enter image description here"></a></p>
  
  <p>The <code>UIView</code> is still in portrait, so the <code>UICollectionView</code> constraint's can't be updated with the new orientation...</p>
  
  <p>Any ideas? </p>