Developing universal in Xcode 6

本小妞迷上赌 提交于 2019-11-28 18:40:23

To support the new Size Classes, you'll need to enable "Use Size Classes" in the File Inspector of your storyboard. This will allow you to configure your storyboard for multiple device sizes.

Note that this will make your storyboard incompatible with Xcode 5.

When you've enabled this, you'll see the size selector appear at the bottom of the screen. Use this to select your device size:

In your project preferences, you can still select a different storyboard for iPhone or iPad using the dropbown box. Notice that the storyboard name will persist if you select a different one for each device.

Even though this is still an option, Apple is moving developers towards a single, unified storyboard.

It seems Auto layout is used to support all devices now, yet you can create separate storyboards? Have you tried calling the separate storyboards in code in the app delegate

    if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
       //Use iPhone Storyboard

     } else {

       //Use iPad Storyboard
     }

After Xcode 6 > version for using different storyboard for iPhone and iPad need to follow xcode-6-separate-storyboard-for-ipad-and-iphone

Note : For Application which does not use Auto Layout, so while adding new storyboard for iPad and disabling auto layout, a pop will appear that's where you need keep size class data to iPad as shown in below screen.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!