@StateObject vs. @ObservedObject: The differences explained 0 ▲ SwiftLee 86 days ago · Tech · hide · Fediverse post @StateObject and @ObservedObject both connect an ObservableObject to a SwiftUI view. The key difference is ownership: use @StateObject when the view creates the object and @ObservedObject when the view receives it from elsewhere. Choosing the wrong wrapper can cause your model to be recreated whenever SwiftUI rebuilds a view. I made this mistake myself because both wrappers initially appeared to produce the same result. … → The post @StateObject vs. @ObservedObject: The differences explained appeared first on SwiftLee. Commenting on Bubbles has been removed. Why? If you want to talk about this post, write to the author, use the comments on their blog if it has them, or reply with a "RE:" post on your own blog. Suggestions? feedback@bubbles.town