Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

8
  • I have the logic for handling OAuth callbacks in the Scene Delegate and a closure that I wanted to access in the ViewController when the callback occurs. This code perfectly allows me to access the Scene Delegate in the ViewController to access that closure. +1 Commented Oct 30, 2019 at 13:20
  • 5
    This is only valid if your app has one scene. The whole benefit of supporting scenes is that you can have more than one scene. Code like this won't work properly when there is more than one scene.
    – rmaddy
    Commented Nov 11, 2019 at 17:51
  • 1
    This worked really well for Azure's MSAL SDK integration. Thanks for this, saved us some time coding to get the MSAL authentication modal visible. Completely looked over this property in UIApplication apple documentation.
    – matthew
    Commented Jan 14, 2020 at 15:50
  • 4
    This is incorrect, you are getting any first connected UIScene, not the UIScene parent of the UIViewController. Commented Jan 15, 2020 at 18:41
  • 3
    Still, this is not the correct solution because you are getting a value from a global controller, not from your current UIScene. Commented Feb 10, 2020 at 12:40