Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SwiftUI button issue :
- - If button, navigation, or tap gesture don't work in SwiftUI try this call that code inside this simultaneousGesture :
- NavigationLink(destination: cardItem.destination) {
- DamageTypeView(cardItem: cardItem)
- }
- .border(Color.red)
- .buttonStyle(PlainButtonStyle()) // Prevent unwanted button styling.
- .contentShape(Rectangle()) // Make the tappable area clear.
- .simultaneousGesture(TapGesture().onEnded {
- print("Tapped 1")
- // Optional: Add logging or additional handling
- })
- .buttonStyle(PlainButtonStyle())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement