Search code examples
iosinterface-builderxcode-storyboard

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


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


Solution

  • 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