I am creating an application in which the iPad can be used both in landscape and portrait modes. The configuration of my UIViewControllers is as follows:
I have a UIViewControllerc UICollectionViewthat has the following limitations: upper, leading, final, and lower with 0 with its superview (superview is UIViewmine UIViewController).
When I click on a cell, I click another one UIViewControllerin UINavigationController, which is a detailed viewController of the cell. Plain.
When I change the device orientation in the view controller first , the boundaries UICollectionVieware set correctly.
Here is my problem :
If I select cell in UICollectionView, a second detailed viewController is displayed. Then, if in this second ViewController I changed the orientation of the device and then returned to the first viewController, my view UIViewControllerwas not rotated. I do not know why, I tried this without success:
self.view.layoutIfNeeded()in viewDidAppear()my firstViewController to update the constraints according to the current orientation, this did not work. This did not work because I noticed one thing:
The view in the frame of my first viewController still matches the previous orientation, it has not changed ... But if I rotate the device again, it will UIViewControllerdetect changes in orientation and the view restrictions will be set properly.
, : , , , .
GIF:

, , :

UIView , UICollectionView ...
?