๐Ÿ“ฆNavigationLink

โŸฉ

SwiftUI โŸฉ navigation โŸฉ NavigationLink

A SwiftUI built-in view that navigates to a destination view when tapped by a user.

// โญ๏ธ text label
NavigationLink("label") { destinationView.navigationTitle("Destination View") }
// โญ๏ธ label (view builder)
NavigationLink(destination: destinationView) { labelView }
// โญ๏ธ destination/label (view builder)
NavigationLink { destinationView } label: { labelView }

NavigationLink only works inside a NavigationStack or a NavigationSplitView.

Last updated