Skip to content

Instantly share code, notes, and snippets.

@tomasharkema
Created June 7, 2019 07:53
Show Gist options
  • Save tomasharkema/c948506a97f6ab323b4ce694c0994446 to your computer and use it in GitHub Desktop.
Save tomasharkema/c948506a97f6ab323b4ce694c0994446 to your computer and use it in GitHub Desktop.
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
// Moved window creation to the SceneDelegate below
return true
}
// Added this method:
// Here we tell iOS what scene configuration to use
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
connectingSceneSession.userInfo?["activity"] = options.userActivities.first?.activityType
// Based on the name of the configuration iOS will initialize the correct SceneDelegate
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment