Different UIs using size classes on iOS

309 views Asked by At

As we know we can use size classes in conjunction with auto layout on iOS 8 to build a universal app/UI for all the iOS supported devices. Thats awesome.

But my concern is if the UI itself differs, i.e there are different UI components to do the same task on different device Eg: A split view to select in iPad and a regular table view in iPhone, can we use size class to do this. Essentially how do I not show the split view on iPhone and not show the table view on iPad using size classes?

1

There are 1 answers

1
Paulw11 On BEST ANSWER

Just as you can selectively install constraints for different size classes you can also selectively install UI components.

If you don't want a particular component for a given size class, select the size class, add an installation and then clear the checkbox in the storyboard editor.

In the image below, the control would be installed for all size classes except compact width, any height.

enter image description here