📦NavigationLink

SwiftUInavigation ⟩ NavigationLink

// ⭐️ text label
NavigationLink("label") { 
    DestinationView()
        .navigationTitle("Destination View") 
}

// ⭐️ label (view builder)
NavigationLink(destination: DestinationView()) { 
    LabelView() 
}

// ⭐️ destination/label (view builder)
NavigationLink { 
    DestinationView() 
} label: { 
    LabelView() 
}

Last updated

Was this helpful?