Timeline for UIApplication.shared.delegate equivalent for SceneDelegate xcode11?
Current License: CC BY-SA 4.0
10 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 24 at 15:38 | comment | added | Aaban Tariq Murtaza | Its giving me AppSceneDelegate. But in my case, it is 'SceneDelegate'. So i m unable to cast AppSceneDelegate into SceneDelegate | |
Mar 6, 2023 at 6:33 | history | edited | HangarRash | CC BY-SA 4.0 |
Clarified that this solution is only valid when the app will only have one scene.
|
Feb 10, 2020 at 12:40 | comment | added | Pedro Paulo Amorim | Still, this is not the correct solution because you are getting a value from a global controller, not from your current UIScene. | |
Feb 7, 2020 at 13:35 | comment | added | JoeGalind | @PedroPauloAmorim : this is a shortcut for 90% of projects that only have one UIScene. It's three lines of code to quickly achieve this. | |
Jan 15, 2020 at 18:41 | comment | added | Pedro Paulo Amorim |
This is incorrect, you are getting any first connected UIScene , not the UIScene parent of the UIViewController .
|
|
Jan 14, 2020 at 15:50 | comment | added | matthew | 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. | |
Nov 14, 2019 at 21:04 | comment | added | JoeGalind | Yes. Of course. This is a "shortcut" for a one-scene project. You would have to go through the connectedScenes array if you wish to access more than one scene. | |
Nov 11, 2019 at 17:51 | comment | added | rmaddy | 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. | |
Oct 30, 2019 at 13:20 | comment | added | TheBrockEllis | 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 | |
Oct 27, 2019 at 15:12 | history | answered | JoeGalind | CC BY-SA 4.0 |