Created
September 22, 2023 15:45
-
-
Save SmartJSONEditor/4565855ef2c5a289847b05f3e598095c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Requiered to use as @StateObject in a View for proper ownership. | |
extension ViewModel: ObservableObject {} | |
@Observable | |
class ViewModel { | |
/// Details | |
} | |
struct ContentView { | |
/// @Observed object | |
@StateObject private var viewModel = ViewModel() | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment