Swift version: 5.6
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 Play is the first native iOS design tool created for designers and engineers. You can install Play for iOS and iPad today and sign up to check out the Beta of our macOS app with SwiftUI code export. We're also hiring engineers!
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.