I want to modify the layout constraints when the device rotates.
My UIViewController
is composed of 2 UIViews
, in landscape they are horizontally aligned,
and in portrait they are vertically aligned.
It does work actually, in willAnimateRotationToInterfaceOrientation
, I remove the desired constraints and replaced them with others to have the right layout...
But there are problems, during rotation auto layout starts breaking constraints before willAnimateRotationToInterfaceOrientation
is called, so where are we meant to replace our constraints when the device reorientation occurs ?
Another issue is performance, after a few rotations the system doesn't break anymore constraints, but I have a huge performance drop, especially in portrait mode...
See Question&Answers more detail:os