Issue #826
Use isActive
binding
@State private var goesToDetail: Bool = false
NavigationLink(
destination: DetailView(viewModel: viewModel),
isActive: $goesToDetail) {
Button(action: { goesToDetail = true }) {
Text("Next")
}
.buttonStyle(MyButtonStyle))
}
We can also apply buttonStyle
onto NavigationLink
NavigationLink {
FavoritesView()
} label: {
Image(systemImage: "star.fill")
}
.buttonStyle(MyButtonStyle())