I have an app that lays out differently depending on whether it's in portrait or landscape orientation (specifically, whether height > width or not). On rotation, in viewWillTransitionToSize:withTransitionCoordinator:
, I update the constants of some auto layout constraints appropriately. The problem is that at this point the view's frame has not actually rotated yet, so I often get an angry message in the debugger that my constraints can't be satisfied.
My question is this: at what point in the rotation sequence do I modify constraints so that the view's frame has already changed, but I still get the animation alongside the rotation?
This question suggests calling [self.view setNeedsUpdateConstraints]
in willAnimateRotationToInterfaceOrientation
, but that method is now deprecated. I tried calling that method in viewWillTransitionToSize
, but still get the angry messages.