Use Size Classes in Xcode 6 beta
Asked Answered
L

1

15

Built a new project from scratch in Swift in Xcode 6 (Beta 1) and see File Inspector of Storyboard. There is Use Size Classes below Use Auto Layout. This is the screenshot of this.

enter image description here

1) What is Use Size Classes?

2) Is it related with iPhone 6 screen size?

Launderette answered 20/6, 2014 at 6:36 Comment(0)
R
20

Size classes let's you create a single storyboard irrespective of the device. Brings the joy of adaptive layouts(layouts for different canvas sizes instead of specific device, could be compact or regular) More generally a single app for all devices. Now focus on laying out your design abstractly as if for a generic device.

From Whats new in Xcode

Size classes

Size classes for iOS 8 enable designing a single universal storyboard with customized layouts for both iPhone and iPad. With size classes you can define common views and constraints once, and then add variations for each supported form factor. iOS Simulator and asset catalogs fully support size classes as well.

Essentially you just want to create a single storyboard for all layouts iPhone3.5",iPhone4",iPhone6(who knows its size), iPad... You can even design separate layouts for a specific size devices but you are not gonna create a second storyboard. When you lay out user interface items on the Interface Builder canvas in the Any Width | Any Height combination, the layout applies to all sizes of devices for which your app targets.

For more info: Size class design help

NB: Size class is working fine in iOS7 also. I just tested it on iOS7 simulators. If you have any problems in device let me know i will update my answer.

Ries answered 20/6, 2014 at 6:57 Comment(9)
Can the split view is also available in iPhone if I use this?Launderette
Size classes are just for designing your interfaces, You can instantly see how it looks in various devices with different sizes and orientations. Split view is available in iOS8 for iPhone,it's not related to size classes i guessRies
Does anyone know what kind of backwards compatibility this will have? How will it work if you support iOS 7 and iOS 8?Baeyer
It's obvious that Size classes will only be supported by iOS 8 and upwards.Maiduguri
If we want to implement a new app from scratch to supports from iOS 7 and above then what is the best way? if "Use Size Classes" no works in iOS 7.Nugget
@Avalon actually its not obvious. Xcode could manipulate the storyboard when generating a build and create multiple storyboards. It looks like it doesn't but I'm just saying its not obviousStallion
@Avalon Just found out it is possible ---> developer.apple.com/library/prerelease/ios/recipes/…Stallion
@kdogisthebest The link is dead... What was the picture saying?/Can you give a working link? ThanksBergerac
@Aviel Gross web.archive.org/web/20140603144043/https://developer.apple.com/…Erine

© 2022 - 2024 — McMap. All rights reserved.