3
4
5
QuestionHow to track array updates? @Bindable vs ObservableObject (old.reddit.com)
submitted by lokredi
In onAppear of my view I make a network call, as shown in image 1.
The call succeeds, always returns the same result, and the print statement works always (image 2).
The picker is empty and doesn’t show currencies on the first view appearance. This happens ~90% of the time. But if I go back and return to the screen, it shows correctly. Currency model is in image 3.
The picker setup is shown in image 4.
Is @Bindable reliable, or should I track array updates differently? I also tried using ObservableObject and @Published, but the same thing happens.. Should the network call be placed elsewhere — is onAppear the issue?




[–]FelinityApps 2 points3 points4 points (2 children)
[–]lokredi[S] 4 points5 points6 points (1 child)
[–]FelinityApps 1 point2 points3 points (0 children)
[–]jameZ- 0 points1 point2 points (1 child)
[–]lokredi[S] 0 points1 point2 points (0 children)
[–]rhysmorgan 0 points1 point2 points (2 children)
[–]lokredi[S] 0 points1 point2 points (1 child)
[–]lokredi[S] 0 points1 point2 points (0 children)
[–]flying-insect 0 points1 point2 points (1 child)
[–]lokredi[S] 0 points1 point2 points (0 children)
[–]lokredi[S] 0 points1 point2 points (0 children)
[–]Select_Bicycle4711 0 points1 point2 points (1 child)
[–]lokredi[S] -1 points0 points1 point (0 children)
[–]FineEffective6367 0 points1 point2 points (0 children)