Swift version: 5.1
Split view controllers on iPad have an automatic display mode, which means in landscape both the left and right view controllers are visible, but in portrait the left view controller slides over and away as needed.
If this isn't preferable – if, for example, you want to mimic the way the Settings app works in portrait – you can force both view controllers to be visible at all times like this:
yourSplitViewController.preferredDisplayMode = .allVisible
SPONSORED Catch bugs as soon as they happen and know exactly why a crash occurred by integrating Instabug's SDK in one minute. You will automatically receive device data, network logs, and reproduction steps with every bug and crash report.
Available from iOS 8.0
This is part of the Swift Knowledge Base, a free, searchable collection of solutions for common iOS questions.
Link copied to your pasteboard.