Created
June 30, 2020 02:28
-
-
Save aheze/5e796a12a12307c4c4e5c23904899a00 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| import SwiftUI | |
| class AppDelegate: NSObject, UIApplicationDelegate { | |
| func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { | |
| if let shortcutItem = launchOptions?[UIApplication.LaunchOptionsKey.shortcutItem] as? UIApplicationShortcutItem { | |
| if shortcutItem.type == "com.example.ExampleApp.exampleAction" { | |
| print("Action Pressed!") | |
| } | |
| } | |
| return true | |
| } | |
| } | |
| @main | |
| struct SwiftUI_AppApp: App { | |
| @UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate | |
| var body: some Scene { | |
| WindowGroup { | |
| ContentView() | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment