David Beck :xcode: on Nostr: So earlier this year we got this very useful piece of documentation from Apple on how ...
So earlier this year we got this very useful piece of documentation from Apple on how to initialize StateObject properly that takes advantage of autoclosure to avoid re-initializing observable objects each time the view is rendered. https://developer.apple.com/documentation/swiftui/stateobject#Initialize-state-objects-using-external-data
But with Observable, you use State instead of StateObject, which doesn't have an autoclosure initializer. So… what are you suppose to do?
But with Observable, you use State instead of StateObject, which doesn't have an autoclosure initializer. So… what are you suppose to do?