Conclusion

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.

Unlock now

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
Download course materials from Github
Previous: Demo Next: Quiz: Hierarchical Navigation Structures