Post

Replies

Boosts

Views

Activity

Comment on iOS 14 .onAppear() is called on DISappear instead of appear
I recommend not to go back to using UIKit. There is an interesting approach here. The solution is to use a model class that conforms to ObservableObject, and use @Published variables in the NavigationLink selection. Add willSet/didSet to these variables, and you will know when a selection was made. willSet/didSet do not work on @State variables so using @Published variables does the trick. A similar approach is also taken on this sample code by Apple.
Jul ’22