swiftui navigation on button click code example
Example: swiftui navigation button
ForEach (self.drinks, id: \.name)
{
drink in
//detail: The SwiftUI view you want to go to
NavigationLink(destination: DrinkDetail(drink: drink))
{
//the button/image you click on to go to that view
DrinkItem(drink: drink)
.frame(width: 300)
.padding(.trailing, 30)
}
}