I need to disable the animation that plays when the orientation changes. Is this possible? If not, is it possible to speed it up?
Just to clarify, i don\'t want to s
In iOS8 you can disable rotation animations by disabling CALayer animations in your view controller's implementation of viewWillTransitionToSize
.
The inverse rotation mentioned in the accepted answer is useful if you want to customize the transition (see WWDC 2014 'View Controller Advancements in iOS 8') but not if you just want to prevent animation.
(N.B. Implementing viewWillTransitionToSize
will prevent the deprecated pre-iOS8 rotation APIs from being called.)
- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id)coordinator
{
[super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
[CATransaction begin];
[CATransaction setDisableActions:YES];
[coordinator animateAlongsideTransition:^(id context) {
// You could make a call to update constraints based on the
// new orientation here.
} completion:^(id context) {
[CATransaction commit];
}];
}