Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IOS Universal App Rotation

I have recently converted my IPad application into a Universal Application. I am re-using a lot of views from my IPad version to the IPhone version.

The IPad needs to support all orientations, is there a way to specify the IPad version to allow any orientation, but IPhone to just allow portrait?

like image 643
Chris Kooken Avatar asked Mar 13 '26 14:03

Chris Kooken


1 Answers

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{
    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone && interfaceOrientation != UIInterfaceOrientationPortrait)
    {
        return NO;
    }
    else
    {
        return YES;
    }
}
like image 76
Simon Goldeen Avatar answered Mar 16 '26 04:03

Simon Goldeen