Introduction
It’s a rare app that can work with only a single view. Most apps need many views, and building intuitive and well-designed navigation between these views is often the difference between a good app and a great app. The navigation you design has to balance many needs. You need to display data logically to the user, provide a consistent way to move between views and make it easy for the user to figure out how to perform a particular task. SwiftUI provides a unified interface to manage navigation while also displaying data.
When designing the navigation for your SwiftUI app, you must create a navigation pattern that helps the user move confidently through the app and intuitively perform tasks. Your users will rarely notice well-done navigation, but they won’t stand for an app that’s hard to navigate or makes it hard to find information. SwiftUI is a cross-platform framework but takes its primary design inspiration from iOS and iPadOS. Therefore, SwiftUI integrates common patterns and design guidelines from those platforms.
In this lesson, you’ll explore the basics of navigation between views in response to user input and programmatically. By the end of this lesson, you will understand SwiftUI’s navigation foundations and key components, understand and implement NavigationStack
, and configure a navigation bar with title and bar item.