Lazy-View-SwiftUI
Lazy-View-SwiftUI copied to clipboard
Destination loaded only once
Is there any way of making LazyView load the wrapped view each time a navigationLink is tapped? Currently it loads only once and reuses that view on subsequent navigations
you could try combining it with this technique https://github.com/joehinkle11/AutoRerenderingView
probably better if you rely on onAppear though
Thanks, I'll have a look into the AutoRenderingView. The problem that I see with onAppear() is that if I'm in a navigation stack and do a network call on appear, it will be done both when the view is pushed, as well as popped. An event hook similar to viewDidLoad would be best
you can always use this janky hack I use...make a static variable and put a "didLoad" flag there. Then check if it's already flipped on onAppear.
ahhh SwiftUI...