I am using @EnvironmentObject in my SwiftUI project, I need to get access to the var of @EnvironmentObject a View in an another class outside of that View, how can I do this?
I do not what make a new Object of used model of @EnvironmentObject, I want get access to the same Object, as like View but inside another class.
update: the main Goal of @EnvironmentObject is making our class be accessible in all Views of SwiftUI, but I see a big problem, that I cannot access to this @EnvironmentObject inside a random class, is there some code that I am missing for this goal?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…