How/whether to make a universal storyboard in Xcode

前端 未结 2 462
长发绾君心
长发绾君心 2021-01-12 10:40

When creating a storyboard file in Xcode, you must select if it is for iPhone or iPad. This implies one should always put iPhone and iPad UIs into separate storyboards. Is

2条回答
  •  走了就别回头了
    2021-01-12 10:58

    As of Xcode 6, we can create a single unified storyboard for all the devices. For more info - Documentation

    iOS 8 makes dealing with screen size and orientation much more versatile. It is easier than ever to create a single interface for your app that works well on both iPad and iPhone, adjusting to orientation changes and different screen sizes as needed. Design apps with a common interface and then customize them for different size classes. Adapt your user interface to the strengths of each form factor. You no longer need to create a specific iPad storyboard; instead target the appropriate size classes and tune your interface for the best experience.

    There are two types of size classes in iOS 8: regular and compact. A regular size class denotes either a large amount of screen space, such as on an iPad, or a commonly adopted paradigm that provides the illusion of a large amount of screen space, such as scrolling on an iPhone. Every device is defined by a size class, both vertically and horizontally. iPad size classes shows the native size classes for the iPad. With the amount of screen space available, the iPad has a regular size class in the vertical and horizontal directions in both portrait and landscape orientations.

    Edit: It only supports iOS 8(backward compatible applies only for iOS 7) and later.

提交回复
热议问题