Reputation: 512
I am trying out the new Xcode6. When I create a new project for an iPhone and I open up the storyboard, the default UIViewController is wider than the iPhone width.
Why is that so?
Upvotes: 1
Views: 609
Reputation: 56372
That's due to a new feature in Interface Builder, that enables designing for multiple device sizes and orientations in a single Storyboard. From the docs:
Size classes for iOS 8 make dealing with different screen sizes and orientations more flexible. You can create a single interface that works on both iPad and iPhone, automatically adjusting to orientation change as well. Use size classes to design a single, universal storyboard, with small customizations, which adjusts to the strengths of each form factor. There is no longer any need to create an device-specific storyboard—instead, you target the appropriate size classes and tune your interface for the best experience on each device. iOS Simulator fully supports size classes as well.
When working with size classes, ViewControllers are represented with square views by default, in order to make clear that you aren't laying out the views in a specific orientation or interface size.
You can disable Size Classes on a per storyboard basis. Just uncheck the Use Size Classes option:
For more detail on Size Classes, refer to the Apple Docs
Upvotes: 2