IOS rotates on a specific page and ios page
1. Add a tag in AppDelegate. h.
2. Add this method in AppDelegate. m.
3. Use
[(AppDelegate *) [UIApplication sharedApplication]. delegate setAllowRotation: YES];
To enable screen Rotation
4. Use
[(AppDelegate *) [UIApplication sharedApplication]. delegate setAllowRotation: NO];
[[Nsicationcenter center defacenter center] removeObserver: self];
If ([[UIDevice currentDevice] respondsToSelector: @ selector (setOrientation :)]) {
SEL selector = NSSelectorFromString (@ "setOrientation :");
NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: [UIDevice instanceMethodSignatureForSelector: selector];
[Invocation setSelector: selector];
[Invocation setTarget: [UIDevice currentDevice];
Int val = UIInterfaceOrientationPortrait;
[Invocation setArgument: & val atIndex: 2];
[Invocation invoke];
}
To cancel screen Rotation