Created
January 5, 2020 14:42
-
-
Save ycui1/68b2e008dbc06061ad7f293a6525e6c6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { | |
let contentView = ContentView() | |
if let windowScene = scene as? UIWindowScene { | |
let window = UIWindow(windowScene: windowScene) | |
window.rootViewController = UIHostingController(rootView: contentView) | |
self.window = window | |
window.makeKeyAndVisible() | |
} | |
if let shortcutItem = connectionOptions.shortcutItem { | |
let alertController = UIAlertController(title: "ActionSheet", message: "Launched with \(shortcutItem.type)", preferredStyle: .actionSheet) | |
alertController.addAction(UIAlertAction(title: "Dismiss", style: .cancel, handler: nil)) | |
window?.rootViewController?.present(alertController, animated: true, completion: nil) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment