@darkpaw the question is when is it called, but how many times it is called. both task and onAppear are called every time the view appears, like for example when the user navigated to another tab of the app and then comes back to it. viewDidLoad on the other hand was called only once. It can be achieved with a modifier holding a boolean to flag if the action ran already. But I am sure that the fact viewDidLoad is missing in SwiftUI is by design. And I would love to understand why is that.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: