Implementing Split View / Slide Over for iPad App
iPadOS Multitasking — Split View (two apps side by side), Slide Over (app in floating window), Stage Manager (iOS 16+, windows of free size) — all this works only if the app properly supports flexible window sizes. An app deployed on iPad without Multitasking support displays with dark bars in compact mode and doesn't appear in available list for Split View — this is immediately visible as unfinished work.
What's Required for Basic Support
Enable Multitasking in Info.plist. For full Split View and Slide Over support — remove UIRequiresFullScreen = YES. If this key is set to true, the app is forced to occupy the entire screen and is unavailable for Split View.
SceneDelegate and Multiple Windows support — necessary for Stage Manager:
// Info.plist
// UIApplicationSceneManifest → UISceneConfigurations → UIWindowSceneSessionRoleApplication
// There also: UIApplicationSupportsMultipleScenes = true
AutoLayout without hardcoded sizes. This is 90% of the work. Every frame, constant, and multiplier is calculated from view.bounds — not from magic 768 or 1024.
Size Classes: traitCollection Instead of Hardcode
iPad in Split View changes horizontalSizeClass from .regular to .compact on narrow window. Code tied to UIDevice.current.userInterfaceIdiom == .pad instead of size class will break:
// Bad — device-dependent
if UIDevice.current.userInterfaceIdiom == .pad {
showSidebar()
}
// Correct — size class-dependent
override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
super.traitCollectionDidChange(previousTraitCollection)
if traitCollection.horizontalSizeClass == .regular {
showSidebar()
} else {
hideSidebar()
}
}
In SwiftUI — @Environment(\.horizontalSizeClass):
struct ContentView: View {
@Environment(\.horizontalSizeClass) var sizeClass
var body: some View {
if sizeClass == .regular {
NavigationSplitView {
SidebarView()
} detail: {
DetailView()
}
} else {
NavigationStack {
MainView()
}
}
}
}
NavigationSplitView — native component for iPad master-detail. Automatically adapts to different size classes, supports three-column layout (sidebar, content, detail) without manual management.
UISplitViewController for UIKit
For UIKit apps, UISplitViewController is the right choice. Important properties:
let split = UISplitViewController(style: .doubleColumn)
split.preferredDisplayMode = .oneBesideSecondary
split.preferredSplitBehavior = .tile
split.presentsWithGesture = true // swipe to hide sidebar
// Minimum width of primary column
split.minimumPrimaryColumnWidth = 280
split.maximumPrimaryColumnWidth = 400
split.preferredPrimaryColumnWidth = 320
style: .tripleColumn for three-column layout (mail, messages). presentsWithGesture = true allows hiding/showing sidebar with swipe — expected behavior on iPad.
Adaptation on collapse: when Split View goes into compact mode (Slide Over, narrow Split), controllers "collapse" into a stack. Override logic via delegate:
func splitViewController(
_ svc: UISplitViewController,
topColumnForCollapsingToProposedTopColumn proposedTopColumn: UISplitViewController.Column
) -> UISplitViewController.Column {
// Show sidebar instead of detail on collapse if detail is empty
if detailViewController.isEmpty {
return .primary
}
return proposedTopColumn
}
Drag & Drop Between Columns
In Split View, users expect Drag & Drop — especially in productivity apps. UIDropInteraction and UIDragInteraction are added to View:
let dropInteraction = UIDropInteraction(delegate: self)
targetView.addInteraction(dropInteraction)
func dropInteraction(_ interaction: UIDropInteraction,
performDrop session: UIDropSession) {
session.loadObjects(ofClass: NSString.self) { items in
// Handle drop
}
}
For SwiftUI — .onDrop(of:delegate:) and .draggable().
Keyboard and Pointer Support
iPad with Magic Keyboard is trackpad and keyboard. Without UIPointerInteraction (hover effects) and keyboard shortcuts, the app looks unpolished on iPad Pro.
// Keyboard shortcut
let command = UIKeyCommand(input: "N", modifierFlags: .command,
action: #selector(newItem),
discoverabilityTitle: "New item")
addKeyCommand(command)
UIMenuBuilder for adding items to system menu (Edit, View), important when working with Magic Keyboard.
Timeline Benchmarks
| Task | Timeline |
|---|---|
| Basic Split View support (UISplitViewController) | 1–2 days |
| Full adaptation with size class, Drag & Drop | 3–4 days |
| + Stage Manager + Keyboard shortcuts | +1 day |
| SwiftUI NavigationSplitView from scratch | 2–3 days |







