I want to specify a Link in my SwiftUI view, but I also want to register when/if that Link
was actually tapped or not. What's the best way to do this? I tried adding an onTapGesture
on the Link (which is a View I believe):
Link("Test", destination: URL(string: "testThreePanel://")!)
.onTapGesture {
print("Testing button link tapped")
}
But the onTapGesture
doesn't get invoked on tapping the link.
Is there another way to do this?