Hi,
I noticed a change of behaviour on onAppear, now when I click a NavigationLink, the onAppear(s) of the views that contain the NavigationLink get called. Didn't happen on iOS 13 at least to me... Basically the body gets re-rendered I guess
List(selection: $selection) {
ForEach(smoothies) { smoothie in
NavigationLink(
destination: SmoothieView(smoothie: smoothie).environmentObject(model),
tag: smoothie,
selection: $selection
) {
SmoothieRow(smoothie: smoothie)
}
.tag(smoothie)
.onReceive(model.$selectedSmoothieID) { newValue in
guard let smoothieID = newValue, let smoothie = Smoothie(for: smoothieID) else { return }
selection = smoothie
}
}
}.onAppear {
print("Did Appear")
}
Cheers!
I noticed a change of behaviour on onAppear, now when I click a NavigationLink, the onAppear(s) of the views that contain the NavigationLink get called. Didn't happen on iOS 13 at least to me... Basically the body gets re-rendered I guess
List(selection: $selection) {
ForEach(smoothies) { smoothie in
NavigationLink(
destination: SmoothieView(smoothie: smoothie).environmentObject(model),
tag: smoothie,
selection: $selection
) {
SmoothieRow(smoothie: smoothie)
}
.tag(smoothie)
.onReceive(model.$selectedSmoothieID) { newValue in
guard let smoothieID = newValue, let smoothie = Smoothie(for: smoothieID) else { return }
selection = smoothie
}
}
}.onAppear {
print("Did Appear")
}
Cheers!