Search code examples
iosxcodeautolayoutuistoryboardsize-classes

How to design storyboard for specific devices instead of size classes


I have been using size classes till Xcode 7 for all my UI needs and started using Vary for Traits from Xcode 8 but when I want to make device specific changes

Mostly iPhone 4s,iPhone 5s and iPhone 6 falls in the same size class i.e Compact width Regular height and this is where I am facing the problem

I couldn't do it in storyboard easily I always have to write code swift or objective c to make it happen.

Is there any standard way to achieve through storyboard or interface builder ?


Solution

  • One of my questions similar to you.

    What is the proper way to calculate Left, right, top, bottom constraint according to different devices?

    By the way i follow your approach too but after stackView it is so much easier than before.I don't have to pull all the nslayoutconstraint and do multiply with aspect ratio very much.

    So my suggestion is to use stackView

    Reason: At least you don't have to write so much code(multiply by aspect ratio,i guess)