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

The Making of Basculo

Postgres on Synology

Build an independent watch app - PART IV