---
title: "TN3154: Adopting SwiftUI navigation split view"
framework: technotes
role: article
role_heading: Article
path: technotes/tn3154-adopting-swiftui-navigation-split-view
---

# TN3154: Adopting SwiftUI navigation split view

Use navigation split view to enable two and three column navigation in your SwiftUI app while maintaining compatibility with earlier OS versions.

## Overview

Overview NavigationSplitView is a view that presents views in two or three columns, where selections in leading columns control presentations in subsequent columns. The Navigation split view API is available on iOS 16, macOS 13, tvOS 16, watchOS 9 and visionOS 1. Transition from the deprecated NavigationView API if your app has a minimum deployment target of at least iOS 16, macOS 13, tvOS 16, watchOS 9 or visionOS 1. For more information, see Migrating to new navigation types. This document describes how using a custom wrapper makes it easier to adopt NavigationSplitView and ensures your app remains compatible with the deprecated NavigationView, without increasing the app deployment target. Using API availability check to provide backward compatibility using a custom wrapper Use the #available() keyword to execute code conditionally based on required platform and version. This allows your app use NavigationSplitView if the specified OS versions are iOS 16, macOS 13, tvOS 16, watchOS 9 or visionOS 1 while supporting NavigationView for earlier OS versions. To ensure backward compatibility on earlier versions of iOS, macOS, tvOS and watchOS, create and use a custom wrapper view that conditionally uses either NavigationSplitView or NavigationView depending on the availability of the API. For apps that use one column navigation view, consider using NavigationStack. struct NavigationSplitViewWrapper<Sidebar, Content, Detail>: View where Sidebar: View, Content: View, Detail: View {     private var sidebar: Sidebar     private var content: Content     private var detail: Detail          init(         @ViewBuilder sidebar: () -> Sidebar,         @ViewBuilder content: () -> Content,         @ViewBuilder detail:  () -> Detail     ) {         self.sidebar = sidebar()         self.content = content()         self.detail = detail()     }          var body: some View {         if #available(iOS 16, macOS 13, tvOS 16, watchOS 9, visionOS 1, *) {             // Use the latest API available             NavigationSplitView {                 sidebar             } content: {                 content             } detail: {                 detail             }         } else {             // Alternative code for earlier versions of OS.             NavigationView {                 // The first column is the sidebar.                 sidebar                                  // Initial content of the second column.                 content                                  // Initial content for the third column.                 detail             }             .navigationViewStyle(.columns)         }     } } note: Navigation split view collapses all of its columns into a stack and shows the last column that displays useful information for compact size classes, such as on iPhone or in iPad’s Slide Over mode. It also collapses all of its columns into a stack on Apple Watch and Apple TV, regardless of the size class. Revision History 2023-08-29 First published.

## See Also

### Latest

- [TN3210: Optimizing your app for iPhone Mirroring](technotes/tn3210-optimizing-your-app-for-iphone-mirroring.md)
- [TN3211: Resolving SwiftUI source incompatibilities for State and ContentBuilder](technotes/tn3211-resolving-swiftui-source-incompatibilities-for-state-and-contentbuilder.md)
- [TN3212: Adopting gesture recognizers for Sidecar touch support](technotes/tn3212-adopting-gesture-recognizers-for-sidecar-touch-support.md)
- [TN3208: Preparing your app’s launch screen to meet App Store requirements](technotes/tn3208-preparing-your-apps-launch-screen-to-meet-app-store-requirements.md)
- [TN3205: Low-latency communication with RDMA over Thunderbolt](technotes/tn3205-low-latency-communication-with-rdma-over-thunderbolt.md)
- [TN3206: Updating Apple Pay certificates](technotes/tn3206-updating-apple-pay-certificates.md)
- [TN3179: Understanding local network privacy](technotes/tn3179-understanding-local-network-privacy.md)
- [TN3190: USB audio device design considerations](technotes/tn3190-usb-audio-device-design-considerations.md)
- [TN3194: Handling account deletions and revoking tokens for Sign in with Apple](technotes/tn3194-handling-account-deletions-and-revoking-tokens-for-sign-in-with-apple.md)
- [TN3193: Managing the on-device foundation model’s context window](technotes/tn3193-managing-the-on-device-foundation-model-s-context-window.md)
- [TN3115: Bluetooth State Restoration app relaunch rules](technotes/tn3115-bluetooth-state-restoration-app-relaunch-rules.md)
- [TN3192: Migrating your iPad app from the deprecated UIRequiresFullScreen key](technotes/tn3192-migrating-your-app-from-the-deprecated-uirequiresfullscreen-key.md)
- [TN3151: Choosing the right networking API](technotes/tn3151-choosing-the-right-networking-api.md)
- [TN3111: iOS Wi-Fi API overview](technotes/tn3111-ios-wifi-api-overview.md)
- [TN3191: IMAP extensions supported by Mail for iOS, iPadOS, and visionOS](technotes/tn3191-imap-extensions-supported-by-mail.md)
