How to create different layouts for portrait and landscape in a launch storyboard?

My app has different layouts when in the iPad is in horizontal or in vertical orientation. It uses the size of the view controller to determine its orientation – regardless of the device's actual orientation (for example, the iPad Pro in split screen landscape mode would be in "portrait" mode since each half's height is larger than its width.


I'm trying to create a launch storyboard for the app that shows its "blank state". However I'm having difficulties in setting up differing layout constraints for horizontal and vertical modes in the storyboard.


In Xcode 11.4.1 I see only size classes and color gamut as criteria to activate/de-activate layout constraints. Similarly stack view's axis could only be differentiated by size classes. However iPad has the same size classes when shown in portrait or landscape. The size class only changes when the app is in split screen or slide-over mode.


Is there a way to lay-out launch storyboards differently based on the orientation of the view?

Replies

It seems you are trying to put too many things in the launch storyboard.


It is not done for this (for instance, strings cannot be localized).


However, you can set contraints, which allows to adapt the display to the screen size. If you set for instance an image position relative to center horizontal and at some distance of bottom, that will adapt automatically to orientation.


So, I would advise to simplify your launchscreen design.