I'm trying to catch the tap on an item in a menu, but I can't get it to work.
I've tried something like this:
Menu("Tap me") {
ForEach (references, id: \.self) { ref in
Link(ref.name, destination: URL(string: ref.url))
.simultaneousGesture(TapGesture().onEnded{
onLinkTapped()
})
.onTapGesture{
onLinkTapped()
}
}
}
but I never get to the onLinkTapped(). If it's not inside a Menu, then it works, but not inside the menu. How to catch the tap gesture?