How can I set all viewcontroller as a landscape in storyboard XCode6 (Swift)

5.4k Views Asked by At

My iPad application is fixed on landscape, and can't be changed during the whole lifetime.

I setup the project as:

project setup

and then in storyboard, I set the orientation as the landscape, but I don't know why the view does not change to landscape?

storyboard setup

Note: I am using Swift, XCode6.3.2, iOS8.1

4

There are 4 best solutions below

1
On BEST ANSWER

enter image description here

In the any | component click on it and mouse over you can see the bottom text said the size of view for iPhone and iPad like following images.

enter image description here

enter image description here

enter image description here

if your application size class desable then that show direct reflaction like old way. but when your app size class enable that need to use with wAny hComponet

if size class enable with landscape:

enter image description here

Same if size class disable with landscape:

enter image description here

If you want to use size class then you need to check viewcontroller preview like following step:

  • Select view controller and then click on show the assistant editore.

enter image description here

  • Then you have two part on your xcode like following:

enter image description here

  • select a preview from following dropdown screenshot:

enter image description here

enter image description here

  • after select prview you can see the right side one view that is the preview of your viewcontroller view's you can change it landscape or portrait by following.

enter image description here

  • you can also check with all size by create new preview view by following.

enter image description here

0
On

In simulated metrics, you've got the size selected as Inferred. If you want to see what it looks like on a specific device type, select that from the first drop down list.

0
On

In the storyboard, the scene is universal so that you can use auto layout to adapt for various devices and orientations.

You can select iPad specifically from the simulated metrics:

Simulated metrics

Or you can, modify universal storyboard layout from the bottom panel. enter image description here

0
On

Updated answer for Xcode 8 - Click the View as: text at the bottom of the storyboard.

Rotate to landscape