0

What I want is Portrait orientation for iPhone and Landscape orientation for iPad app. My app is targeted for >
I searched on web about this but got different answers but not the exact one.

Inder Kumar Rathore
  • 39,458
  • 17
  • 135
  • 184

2 Answers2

0

So here is what I did

For iPhone enter image description here

and for iPad enter image description here

And for iPad controllers I added below code, this is not necessary for applications

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationLandscapeRight ||
            interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
}
Inder Kumar Rathore
  • 39,458
  • 17
  • 135
  • 184
0

You should be able to do this by simply adding this code to your app delegate.

Swift code:

func application(application: UIApplication, supportedInterfaceOrientationsForWindow window: UIWindow?) -> Int {
    if UIDevice.currentDevice().userInterfaceIdiom == .Phone {
        return Int(UIInterfaceOrientationMask.Portrait.rawValue)
    } else {
        return Int(UIInterfaceOrientationMask.LandscapeLeft.rawValue | UIInterfaceOrientationMask.LandscapeRight.rawValue)
    }
}
Travis M.
  • 10,930
  • 1
  • 56
  • 72