Questions tagged environmentobject

Explore the latest questions and answers asked by our top developers.

Trying to access the environment object created inside scene delegate by another scenedelegate function

I have created an environment object in my scendelegate and want to also use it in another function that resides inside my scenedelegate. The code looks as follows: SceneDelegate.swift class SceneDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? //@EnvironmentObject var data: DataFetcher var data = DataFetcher() func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) […]

By TJ D Alessandro
Categorised as environmentobject, ios, swiftui, xcode12 Tagged , , ,

Still Have Questions?

Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us