public

UIAppDelegate and SceneDelegate accessing variables

As you likely know iOS 13 introduced the multiple window concept. Which means what you used to do with (UIApplication.shared.delegate as! AppDelegate).somevariableHERENo longer works and I am

2 years ago

Latest Post Simply put. by Mario Esposito public

As you likely know iOS 13 introduced the multiple window concept. Which means what you used to do with

(UIApplication.shared.delegate as! AppDelegate).somevariableHERE

No longer works and I am happy to tell you that you can still do it just slightly different. And in my opinion clearer.

(self.window?.windowScene?.delegate as! SceneDelegate).someOtherVariableHere

References

Apple usual bare-extreme-bone docs

Background

Mario Esposito

Published 2 years ago