๐ŸŽNavigationLink

NavigationView {                        // navigation view
    List {                              // list   
        Section {                       // list section
            // navigation link โญ๏ธ
            NavigationLink(destination: ContentView()) {
                Label("Settings", systemImage: "gear")
            }
            
            // multiple trailing closures โญ๏ธ
            NavigationLink { 
                ContentView() 
            } label: {
                Label("Billings", systemImage: "creditcard")
            }
            
            NavigationLink { 
                Text("No Luck Here.") 
            } label: {
                Label("Help", systemImage: "questionmark")
                    .tint(.orange)      // .tint() DOESN'T workโ—๏ธ
            }
            
            NavigationLink {
                Text("You're not going anywhere.")
            } label: {
                HStack {
                    Image(systemName: "gear")   // not affected by accent color
                    Text("Big Settings")
                        .font(.subheadline.weight(.bold))
                }
            }
        }.tint(.red)  // tint (accent) color
        
        Section {
            // โญ๏ธ hyperlink
            Link(destination: URL(string: "https://apple.com")!) {
                HStack {
                    Label("Apple", systemImage: "house")
                    Spacer()
                    Image(systemName: "link").tint(.secondary)
                }
            }
        }.tint(.primary)

    }
    .listStyle(.insetGrouped)           // list style
    .navigationTitle("Account")         // navigation title
}

Last updated