Can I use EnvironmentStateObject with the @Observable macro? #55
Unanswered
GregoryZeng
asked this question in
Q&A
Replies: 2 comments 1 reply
|
Hello, @GregoryZeng,
I don't have any ready-made option for instantiating In your own explorations, make sure you carefully read the Store observable objects chapter of the |
0 replies
|
Thanks for your prompt answer.
You mean OK, I thought that |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi,
I am a beginner in SwiftUI and GRDB so correct me if I am wrong 😂
The view models from the docs and examples use the Combine-style
ObservableObject.https://swiftpackageindex.com/groue/grdbquery/0.9.0/documentation/grdbquery/mvvm
https://github.com/groue/GRDBQuery/tree/main/Documentation/MVVMDemo
I wonder if the
@Observablemacro can also apply to the view model with GRDB, removing the@Publishedand theObservableObject?https://developer.apple.com/documentation/swiftui/migrating-from-the-observable-object-protocol-to-the-observable-macro
Thanks.
All reactions