Post

Replies

Boosts

Views

Activity

Reply to SwiftUI NavigationLink with action in List
Edit: also a potential problem with just adding .onAppear to the destination is that will technically fire every time that instance is shown, not just initial navigation. So if that page navigated somewhere and the user hits back, the action would be fired again. There is probably a way of adding a modifier and having checks to only fire the action once... but at the point it still seems like its adding complexity for a very common and simple behavior.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’22