-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathSceneDelegate.swift
More file actions
20 lines (17 loc) · 782 Bytes
/
SceneDelegate.swift
File metadata and controls
20 lines (17 loc) · 782 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import UIKit
class SceneDelegate: NSObject, UIWindowSceneDelegate {
func windowScene(_ windowScene: UIWindowScene, performActionFor shortcutItem: UIApplicationShortcutItem, completionHandler: @escaping (Bool) -> Void) {
guard let url = URL(string: shortcutItem.type) else {
completionHandler(false)
return
}
windowScene.open(url, options: nil, completionHandler: completionHandler)
}
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
if let shortcutItem = connectionOptions.shortcutItem {
if let url = URL(string: shortcutItem.type) {
scene.open(url, options: nil)
}
}
}
}