Use Size Classes in Xcode 6 beta

后端 未结 1 1725
清酒与你
清酒与你 2021-01-31 11:28

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. Th

相关标签:
1条回答
  • 2021-01-31 12:04

    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.

    0 讨论(0)
提交回复
热议问题