I viewed the App Essentials in SwiftUI video this morning. I’m still having trouble understanding when and why I would use the @StateObject property wrapper. I reviewed the developer documentation for the @StateObject property wrapper but it is still confusing on why and how I might use that in a new SwiftUI App struct versus just using a model struct that conforms to the ObservableObject protocol and using the @Punlished property wrapper for a model object and an @ObservedObject property wrapper for an instance of the model in the ContentView.
Why and When to Use @StateObject Property Wrapper
Add a Comment