Post

Replies

Boosts

Views

Activity

Comment on SwiftUI: @StateObject never deinitialized
@muratcankok Use @State properties in your view to store data for display. If it's a lot make a struct with @State, similar like a view model. Then in the view use .onAppear {...}, or .task{...} to run code to fetch your data. The business logic can be in Service classes/structs which you can inject via init() or however you like.
Nov ’22