Reputation: 3970
Is there any way I can perform code before the device orientation animation finishes?
Right now I'm adding myself as an observer to UIDeviceOrientationDidChangeNotification
However I need my code to finish before the change actually occurs not after.
Upvotes: 2
Views: 1453
Reputation: 503
Try to change it in this method:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
Upvotes: 2
Reputation: 18551
Check the documentation :)
Responding to View Rotation Events –
willRotateToInterfaceOrientation:duration:
willAnimateRotationToInterfaceOrientation:duration:
didRotateFromInterfaceOrientation:
Upvotes: 4