Universal application with Portrait orientation for iPhone and Landscape orientation for iPad

user1988 picture user1988 · Jan 5, 2015 · Viewed 10.8k times · Source

I'm creating a Universal application using Swift. I have used Storyboard and Auto-Layouts. Requirement is of creating a universal application which will support Portrait orientation only for iPhone and Landscape orientation only for iPad.

I have developed UI for iPhone and now I will be starting iPad UI.

Also UI created for iPhone is not same as UI created for iPad, both UI's are quite different.

I'm thinking of to create separate storyboards for iPhone and iPad. Is there any proper way to achieve this?

Answer

Hamza Azad picture Hamza Azad · Mar 15, 2015

Go to the info.plist file and add an array with key "Supported interface orientations (iPhone)" and add the following values in it:

  1. Portrait (bottom home button)

Similarly, add another array "Supported interface orientations (iPad)" and add the following:

  1. Portrait (bottom home button)
  2. Landscape (left home button)
  3. Landscape (right home button)

See below: enter image description here