How can I build a list of navigation list using ForEach in SwiftUI. I thought of something like below but it doesn't work.
struct ContentView: View {
var menuButtons = ["Profile", "About Us", "Contact Us"]
var body: some View {
ForEach(menuButtons, id:\.self) {menu in
NavigationView(content: {
NavigationLink(destination: {
if menu == "Profile" {
Profile()
}
if menu == "About Us" {
AboutUs()
}
}) { Text(menu) }
})
}
}
}

