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).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

Comments

Popular posts from this blog

Build an independent watch app - PART IV

Build an independent watch app - Part II

It's all matter of angles, in life