swiftui button click navigation 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)
}
}