10

I am developing app using Xcode 8 (beta 1). Unfortunately, I am not able to find "Size Classes" option.

In Xcode 7, there was option "Use Size Classes".

enter image description here

But in Xcode 8 there is no such option. Is there any help for using Size Classes or similar in Xcode 8?

Khawar
  • 9,151
  • 9
  • 46
  • 67

2 Answers2

10

Now you have "Use Trait Variations" which is improved version of Size Classes

enter image description here


You can now select device based and orientation based trait view much like size classes (iPad Pro, iPad, iPhone 6Splus, iPhone 6s, iPhone SE and iPhone 4s)

enter image description here

Bhumit Mehta
  • 16,278
  • 11
  • 50
  • 64
  • 2
    How can I have common layout for all resolutions? w - Any h - Any – Satyam Sep 21 '16 at 13:58
  • Prior to Xcode 8, any needed to be explicit, and in some places you’ll find explicit uses of any still. Often Xcode 8 hides Any from you, making it implicit instead of explicit. This resource could be useful to you: https://makeapppie.com/2016/09/05/an-introduction-to-size-classes-for-xcode-8/ – Marlon Ruiz Nov 29 '16 at 14:54
  • So I have Use Auto Layout and Trait Variations checked, and my view controllers change size on IB, great. But I thought with Size Classes you could change the view in IB, do some work, then it would save those changes ONLY for that size? – Ethan Parker Feb 02 '17 at 18:23
6

Apple introduce new feature called Trait Variations.

Trait Variation

So now you can simply create how it looks on real device.

enter image description here

You can simply switch devices by just clicking and also change the orientation of your view.

Dhruv Khatri
  • 803
  • 6
  • 15
  • 8
    All iPhones in portrait at wC hR so how to make different layouts for 7+ and 4s sizes? – RyanTCB Sep 23 '16 at 17:23
  • The new layout video is uploaded by apple you can also assign some layout objects for only some devices. – Dhruv Khatri Sep 23 '16 at 17:30
  • I see that video but that's when devices have different Traits. Sadly as all iPhones in portrait have same traits they cant be used to make adaptive layouts – RyanTCB Sep 23 '16 at 18:15
  • @DhruvKhatri How can I set different Vary traits for different iPad orientation? – Tal Zion Jan 09 '17 at 16:09
  • Check out this two videos this will guide you @TalZion Check out Making Apps Adaptive, Part 1 from #WWDC 2016 https://developer.apple.com/wwdc16/222 Part 2 from #WWDC 2016 https://developer.apple.com/wwdc16/233 – Dhruv Khatri Jan 13 '17 at 04:44