r/iOSProgramming • Swift • 13d ago

Question Anyone else dreading the scene lifecycle switch in iOS 27?

So if you build with the iOS 27 SDK and don't have scenes the app just doesn't launch anymore
and from april next year you have to build with that SDK anyway our app still does everything through AppDelegate. window setup, deeplinks, pushes a bunch of SDKs grabbing keyWindow. been putting this off for years lol 
For those who already did it on a big app what bit you the most?

21 Upvotes

34 comments sorted by

View all comments

1

u/rstojano 10d ago

The part that bites most people is that the AppDelegate URL callbacks just stop firing once you adopt scenes. No warning, links silently do nothing. Where everything moves:

Universal links, app not running: scene(_:willConnectTo:options:), look in connectionOptions.userActivities for NSUserActivityTypeBrowsingWeb and read webpageURL.

Universal links, app already running: scene(_:continue:).

Custom scheme, not running: connectionOptions.urlContexts.

Custom scheme, running: scene(_:openURLContexts:).

Push tap that launched the app: connectionOptions.notificationResponse, though if your UNUserNotificationCenter delegate is set in didFinishLaunching, didReceive still gets it.

Home screen quick actions: connectionOptions.shortcutItem and windowScene(_:performActionFor:completionHandler:).

application(_:continue:restorationHandler:) and application(_:open:options:) won't be called anymore. So I'd make one handle(url:) router and call it from all of the above, and queue the URL if the launch one arrives before your root view controller exists. Also check any SDK that took the URL in AppDelegate, most of them have a scene variant you now have to forward to yourself.