I used to make apps in swiftUI and now I'm making an app in UIKit with MVVM architecture.
In SwiftUI. There is a property wrapper called @EnviormentObject that allows you to access a class anywhere in the app.
I want to integrate a viewModel that is initialized in the SceneDelegate and can be accessed from anywhere in the app without needing to reinitialize the class.
An example would be to watch the current user and if its state changes to nil, present a notification to the user. But for that it needs to be a class that is only inited once so it doesn't have to load the data every time it is called.
How can I integrate a class that is inited in SceneDelegate and can be accessed from anywhere in the app?
Thanks.