I often see code like this:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
return YES;
}
If the supported orientation is set in the project configuration, wouldn’t just returning YES all the time be pointless? Or are there certain cases where this has an effect?
shouldAutorotateToInterfaceOrientation:(which is deprecated since iOS 6, by the way) is something completely different than theUISupportedInterfaceOrientationsin the info plist! If you don’t implement this method, the respective view controller won’t ever autorotate to that interface orientation, no matter what you specify inUISupportedInterfaceOrientations.From the documentation of
UISupportedInterfaceOrientations: