Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit d54408e

Browse files
committed
swift format
1 parent a548386 commit d54408e

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

packages/quick_actions/quick_actions_ios/ios/Classes/QuickActionsPlugin.swift

+15-7
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@ public final class QuickActionsPlugin: NSObject, FlutterPlugin {
2424
@objc
2525
public init(
2626
channel: FlutterMethodChannel,
27-
shortcutStateManager: FLTShortcutStateManager = FLTShortcutStateManager())
28-
{
27+
shortcutStateManager: FLTShortcutStateManager = FLTShortcutStateManager()
28+
) {
2929
self.channel = channel
3030
self.shortcutStateManager = shortcutStateManager
3131
}
3232

3333
public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
3434
switch call.method {
3535
case "setShortcutItems":
36-
guard let items = call.arguments as? [[String:Any]] else {
36+
guard let items = call.arguments as? [[String: Any]] else {
3737
preconditionFailure("The argument must be a list of dictionaries")
3838
}
3939
shortcutStateManager.setShortcutItems(items)
@@ -48,13 +48,21 @@ public final class QuickActionsPlugin: NSObject, FlutterPlugin {
4848
}
4949
}
5050

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 {
5255
handleShortcut(shortcutItem.type)
5356
return true
5457
}
5558

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+
{
5866
// Keep hold of the shortcut type and handle it in the
5967
// `applicationDidBecomeActure:` method once the Dart MethodChannel
6068
// is initialized.
@@ -63,7 +71,7 @@ public final class QuickActionsPlugin: NSObject, FlutterPlugin {
6371
// Return false to indicate we handled the quick action to ensure
6472
// the `application:performActionFor:` method is not called (as
6573
// 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).
6775
return false
6876
}
6977
return true

0 commit comments

Comments
 (0)