From 7d1714a2d8d3b34027d365cffee2ea9bd13aa30a Mon Sep 17 00:00:00 2001 From: Ivan Smetanin Date: Mon, 4 Sep 2017 10:49:12 +0300 Subject: [PATCH] Fixed the logic of processing methods. Changed OR to AND --- .../Classes/ApplicationServicesManager.swift | 60 +++++++++---------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/PluggableApplicationDelegate/Classes/ApplicationServicesManager.swift b/PluggableApplicationDelegate/Classes/ApplicationServicesManager.swift index 367045e..22a3fc6 100644 --- a/PluggableApplicationDelegate/Classes/ApplicationServicesManager.swift +++ b/PluggableApplicationDelegate/Classes/ApplicationServicesManager.swift @@ -40,10 +40,10 @@ open class PluggableApplicationDelegate: UIResponder, UIApplicationDelegate { @available(iOS 6.0, *) open func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool { - var result = false + var result = true for service in __services { - if service.application?(application, willFinishLaunchingWithOptions: launchOptions) ?? false { - result = true + if service.application?(application, willFinishLaunchingWithOptions: launchOptions) == false { + result = false } } return result @@ -51,10 +51,10 @@ open class PluggableApplicationDelegate: UIResponder, UIApplicationDelegate { @available(iOS 3.0, *) open func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool { - var result = false + var result = true for service in __services { - if service.application?(application, didFinishLaunchingWithOptions: launchOptions) ?? false { - result = true + if service.application?(application, didFinishLaunchingWithOptions: launchOptions) == false { + result = false } } return result @@ -77,10 +77,10 @@ open class PluggableApplicationDelegate: UIResponder, UIApplicationDelegate { @available(iOS, introduced: 2.0, deprecated: 9.0, message: "Please use application:openURL:options:") open func application(_ application: UIApplication, handleOpen url: URL) -> Bool { - var result = false + var result = true for service in __services { - if service.application?(application, handleOpen: url) ?? false { - result = true + if service.application?(application, handleOpen: url) == false { + result = false } } return result @@ -88,10 +88,10 @@ open class PluggableApplicationDelegate: UIResponder, UIApplicationDelegate { @available(iOS, introduced: 4.2, deprecated: 9.0, message: "Please use application:openURL:options:") open func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool { - var result = false + var result = true for service in __services { - if service.application?(application, open: url, sourceApplication: sourceApplication, annotation: annotation) ?? false { - result = true + if service.application?(application, open: url, sourceApplication: sourceApplication, annotation: annotation) == false { + result = false } } return result @@ -99,10 +99,10 @@ open class PluggableApplicationDelegate: UIResponder, UIApplicationDelegate { @available(iOS 9.0, *) open func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool { - var result = false + var result = true for service in __services { - if service.application?(app, open: url, options: options) ?? false { - result = true + if service.application?(app, open: url, options: options) == false { + result = false } } return result @@ -332,10 +332,10 @@ open class PluggableApplicationDelegate: UIResponder, UIApplicationDelegate { // If unimplemented, the default behavior is to allow the extension point identifier. @available(iOS 8.0, *) open func application(_ application: UIApplication, shouldAllowExtensionPointIdentifier extensionPointIdentifier: UIApplicationExtensionPointIdentifier) -> Bool { - var result = false + var result = true for service in __services { - if service.application?(application, shouldAllowExtensionPointIdentifier: extensionPointIdentifier) ?? true { - result = true + if service.application?(application, shouldAllowExtensionPointIdentifier: extensionPointIdentifier) == false { + result = false } } return result @@ -355,10 +355,10 @@ open class PluggableApplicationDelegate: UIResponder, UIApplicationDelegate { @available(iOS 6.0, *) open func application(_ application: UIApplication, shouldSaveApplicationState coder: NSCoder) -> Bool { - var result = false + var result = true for service in __services { - if service.application?(application, shouldSaveApplicationState: coder) ?? false { - result = true + if service.application?(application, shouldSaveApplicationState: coder) == false { + result = false } } return result @@ -366,10 +366,10 @@ open class PluggableApplicationDelegate: UIResponder, UIApplicationDelegate { @available(iOS 6.0, *) open func application(_ application: UIApplication, shouldRestoreApplicationState coder: NSCoder) -> Bool { - var result = false + var result = true for service in __services { - if service.application?(application, shouldRestoreApplicationState: coder) ?? false { - result = true + if service.application?(application, shouldRestoreApplicationState: coder) == false { + result = false } } return result @@ -396,10 +396,10 @@ open class PluggableApplicationDelegate: UIResponder, UIApplicationDelegate { // or application:didFailToContinueUserActivityWithType:error: if an error was encountered. @available(iOS 8.0, *) open func application(_ application: UIApplication, willContinueUserActivityWithType userActivityType: String) -> Bool { - var result = false + var result = true for service in __services { - if service.application?(application, willContinueUserActivityWithType: userActivityType) ?? false { - result = true + if service.application?(application, willContinueUserActivityWithType: userActivityType) == false { + result = false } } return result @@ -412,10 +412,10 @@ open class PluggableApplicationDelegate: UIResponder, UIApplicationDelegate { // restoreUserActivityState on all objects. @available(iOS 8.0, *) open func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([Any]?) -> Swift.Void) -> Bool { - var result = false + var result = true for service in __services { - if service.application?(application, continue: userActivity, restorationHandler: restorationHandler) ?? false { - result = true + if service.application?(application, continue: userActivity, restorationHandler: restorationHandler) == false { + result = false } } return result