© 2026 LinearBytes Inc.
Search posts, tags, users, and pages
Abdurahmon Jamoliddinov
iOS Dev from Kokand
What do you think about using @ObservedObject instead of @StateObject, is it good practice or is it better to use @StateObject?
Xavier
iOS Developer
it depends on the case. State is the source of truth. So use StateObject in views where the data is created/captured. Other views should use ObservedObject to observe the state.
StateObject
ObservedObject