Changes

Jump to: navigation, search
m
Text replacement - "<google>BUY_IPAD_BOTTOM</google>" to "<htmlet>ios9_upgrade</htmlet>"
Whilst the autosizing features will work for many situations there are some limitations. It is quite possible for example that you will want to change the entire layout of your user interface depending on whether the device is in portrait or landscape orientation. This might involve not only changing the size of view elements but also moving them to specific locations on the screen. Clearly this is beyond the capabilities of autosizing. A useful approach to this situation involves intercepting the rotation of the device and changing the position and dimensions of the user interface components before the screen is redrawn.
In order to achieve this we will need to override the willAnimateRotationToInterfaceOrientation method of the UIViewController class. This is the method that gets called just before the user interface begins to rotate.
<googlehtmlet>BUY_IPAD_BOTTOMios9_upgrade</googlehtmlet>
In order to demonstrate this technique in action we will use our existing layout project. Within Xcode, select the ''layoutViewController.h'' file and add the following outlets so that we can access our two buttons from the controller code:

Navigation menu