i want to detect a rotation process on ipad programmatically. In this case i want to set a boolean into yes, when the rotation will begin, and set it false after the rotation di
All the above methods(in the answer by @Nekto) are deprecated in iOS8.0 and later versions. Source: iOS Developer Library
As of iOS 8, all rotation-related methods are deprecated. Instead, rotations are treated as a change in the size of the view controller’s view and are therefore reported using the viewWillTransitionToSize:withTransitionCoordinator: method. When the interface orientation changes, UIKit calls this method on the window’s root view controller. That view controller then notifies its child view controllers, propagating the message throughout the view controller hierarchy.
In iOS8 or later you can use the below method.
- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id )coordinator
{
[super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
[coordinator animateAlongsideTransition:^(id context) {
// Stuff you used to do in willRotateToInterfaceOrientation would go here.
// If you don't need anything special, you can set this block to nil.
} completion:^(id context) {
// Stuff you used to do in didRotateFromInterfaceOrientation would go here.
// If not needed, set to nil.
}];
}