Search code examples
iosxcodeuiviewcontrollerundefined-behaviorautorotate

What's happening when shouldAutorotateToInterfaceOrientation always returns NO?


Strange question, but what's happening when some UIViewController doesn't support any orientation? :)

// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return NO;
}

Which orientation will be supported? What is going to be behavior of that UIViewController?


Solution

  • by default the orientation is potrait until and unless u have explicitly changed the orientation to landscape.