Running on iOS 8, I need to change the UI when rotating my app.
Currently I am using this code:
-(BOOL)shouldAutorotate
{
UIDeviceOrientation ori
The viewWillTransitionToSize:withTransitionCoordinator:
method is called immediately before the view has transitioned to the new size, as Nick points out. However, the best way to run code immediately after the view has transitioned to the new size is to use a completion block in the method:
- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id)coordinator {
[coordinator animateAlongsideTransition:nil completion:^(id context) {
// your code here
}];
}
Thanks to the this answer for the code and to Nick for linking to it in his comment.