@@ -24,16 +24,16 @@ public final class QuickActionsPlugin: NSObject, FlutterPlugin {
24
24
@objc
25
25
public init (
26
26
channel: FlutterMethodChannel ,
27
- shortcutStateManager: FLTShortcutStateManager = FLTShortcutStateManager ( ) )
28
- {
27
+ shortcutStateManager: FLTShortcutStateManager = FLTShortcutStateManager ( )
28
+ ) {
29
29
self . channel = channel
30
30
self . shortcutStateManager = shortcutStateManager
31
31
}
32
32
33
33
public func handle( _ call: FlutterMethodCall , result: @escaping FlutterResult ) {
34
34
switch call. method {
35
35
case " setShortcutItems " :
36
- guard let items = call. arguments as? [ [ String : Any ] ] else {
36
+ guard let items = call. arguments as? [ [ String : Any ] ] else {
37
37
preconditionFailure ( " The argument must be a list of dictionaries " )
38
38
}
39
39
shortcutStateManager. setShortcutItems ( items)
@@ -48,13 +48,21 @@ public final class QuickActionsPlugin: NSObject, FlutterPlugin {
48
48
}
49
49
}
50
50
51
- public func application( _ application: UIApplication , performActionFor shortcutItem: UIApplicationShortcutItem , completionHandler: @escaping ( Bool ) -> Void ) -> Bool {
51
+ public func application(
52
+ _ application: UIApplication , performActionFor shortcutItem: UIApplicationShortcutItem ,
53
+ completionHandler: @escaping ( Bool ) -> Void
54
+ ) -> Bool {
52
55
handleShortcut ( shortcutItem. type)
53
56
return true
54
57
}
55
58
56
- public func application( _ application: UIApplication , didFinishLaunchingWithOptions launchOptions: [ AnyHashable : Any ] = [ : ] ) -> Bool {
57
- if let shortcutItem = launchOptions [ UIApplication . LaunchOptionsKey. shortcutItem] as? UIApplicationShortcutItem {
59
+ public func application(
60
+ _ application: UIApplication ,
61
+ didFinishLaunchingWithOptions launchOptions: [ AnyHashable : Any ] = [ : ]
62
+ ) -> Bool {
63
+ if let shortcutItem = launchOptions [ UIApplication . LaunchOptionsKey. shortcutItem]
64
+ as? UIApplicationShortcutItem
65
+ {
58
66
// Keep hold of the shortcut type and handle it in the
59
67
// `applicationDidBecomeActure:` method once the Dart MethodChannel
60
68
// is initialized.
@@ -63,7 +71,7 @@ public final class QuickActionsPlugin: NSObject, FlutterPlugin {
63
71
// Return false to indicate we handled the quick action to ensure
64
72
// the `application:performActionFor:` method is not called (as
65
73
// per Apple's documentation:
66
- // https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1622935-application?language=objc ).
74
+ // https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1622935-application).
67
75
return false
68
76
}
69
77
return true
0 commit comments