navigate to another view Swiftui

i have NavigationView in my code

i do this for button it Navigation

      Button{
        print("")
      }label: {
        Image(systemName: "list.dash")
          .foregroundColor(.gray)
      }
    }

how i can navigate to another view when user click the button??

You can use a special type of button that is specifically for navigation called NavigationLink.

Use it like this:

NavigationLink {
    // destination view to navigation to
    DetailView()
} label: {
    Image(systemName: "list.dash")
        .foregroundColor(.gray)
}
navigate to another view Swiftui
 
 
Q