In this lesson, you explored two and three-column navigation using NavigationSplitView in SwiftUI.
Unlike a NavigationStack, these layouts require data displayed using a List and a variable containing the current user’s selection in that list. You then use these selections to show a detailed view to the user.
These layouts work intuitively for data easily portrayed as a list of options, such as events or categories. SwiftUI handles much of the work and formats the columns to take advantage of larger screen devices. However, it loses the flexibility of a NavigationStack and won’t work well for navigation that doesn’t fit neatly into a list of options.
You also learned ways to share data between views in complex navigation hierarchies. While bindings work well in simple cases, using an environment object lets you pass data consistently between views when there are multiple paths to the same destination.
See forum comments
This content was released on Jun 20 2024. The official support period is 6-months
from this date.
Download course materials from Github
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress,
bookmark, personalise your learner profile and more!
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.