Built a new project from scratch in Swift in Xcode 6 (Beta 1) and have seen some strange behaviour with Storyboards and the output that I am viewing.
I have built a simple interface (as shown below) - with properties of View Controller included. When I run this in the simulator I would expect 'Hello, World' to be central in the user interface - however it seems that this 'Square' is simply being fit into the iPhone screen and thus the wrong view is being shown (see below).
My question is: has anyone else seen this behaviour and how did they fix it?
Thanks!
For anyone using XCode 7, it's very easy to design for a specific device size (instead of the default square-ish canvas).
In Interface Builder, select your ViewController or Scene from the left menu. Then under
Show the Attributes Inspector
, go to theSimulated Metrics
, and pick the desiredSize
from the dropdown menu.In Storyboard, select your ViewController and go to Atribute Inspector. At the very top, under Simulated Metrics you have Size and Orientation properties which are set to Inferred. Change them to desired values.
In order for an application to display properly on another screen size, you also have to setup constraints, as described by Can Poyrazoğlu in the first post.
You shall probably use the "Resolve Auto Layout Issues" (bottom right - triangle icon in the storyboard view) to add/reset to suggested constraints (Xcode 6.0.1).