Is it possible for a NavigationLink to perform an action in addition to navigating to another view?

You can use .simultaneousGesture to do that. The NavigationLink will navigate and at the same time perform an action exactly like you want:

NavigationLink(destination: TradeView(trade: trade)) {
    Text("Trade View Link")
}.simultaneousGesture(TapGesture().onEnded{
    print("Hello world!")
})

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)