I am developing an application which supports portrait and landscape modes
. I am using auto layout to arrange my views
. As i have been reading many
The best approach is to use neither. Instead, configure your constraints correctly so that no programmatic changes are required on rotation. The Auto Layout runtime will maintain the views in position as you already have specified.
Updating constraints other than changing the value of .constant
is a real performance hit and should be avoided.
Using viewWillLayoutSubviews
is not necessary. Auto Layout methods are updateViewConstraints
(for the view controller), and updateConstraints
(in the views).