I have a List() of contact emails, each one displayed on a row with some Buttons().
One of the buttons is expected to launch a new mail message.
I should use Link() with “mailto:” scheme but it does not work when different buttons share same row, so I guess I can only use .onTapGesture closure to call a function.
How could I activate a Link() from a self.launchNewMessage() func?
Is there any CallBack from Link() I could use to confirm a success launch?
var body: some View {
List(emails) { email in
HStack() {
VStack() {
Image(systemName: "square.and.pencil")
Text("new message")
}.onTapGesture {
self.launchNewMessage(email.address)
}
//Other Buttons in same row...
}
}
func launchNewMessage(_ emailAddress:String) {
}