Different UI layout for iPhone X family

I need to have different layout for iPhone X family of devices for one view controller. I do not see any straightforward way of doing it in Storyboards so here is what I thought:


1. Different storyboard files for device classes. Problem is I will need to replicate (duplicate) designs for all other view controllers,


2. Leave the view controller empty in the storyboard, even delete the main view. Define interface in Xib files and in loadView method, load the appropriate xib file.


Is there a better way while not leaving Storyboard?

It depends how much different layout should be.


For what cannot be set with constraints directly in IB, you can create IBOutlets for those constraints and change their value ; or even create new constraints programmatically.


Complexity depends on how different the layout should be.

>I need to have different layout for iPhone X family of devices for one view controller.


Perhaps if you discussed why, someone might have specific suggestions.


Note one option is via a device idiom...


In the mean time, see the docs:


https://developer.apple.com/design/human-interface-guidelines/ios/visual-design/adaptivity-and-layout/


https://developer.apple.com/design/

Let's say they are different enough so that it would be painful to layout in code.

Different UI layout for iPhone X family
 
 
Q