import UIKit class SceneDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? func scene( _ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions ) { (UIApplication.shared.delegate as? AppDelegate)?.sceneWillConnect( window: window, launchURL: connectionOptions.urlContexts.first?.url) } func scene(_ scene: UIScene, openURLContexts URLContexts: Set) { guard let appDelegate = UIApplication.shared.delegate as? AppDelegate else { return } for context in URLContexts { _ = appDelegate.application(UIApplication.shared, open: context.url, options: [:]) } } }