From 4cd9d858ad3909b031b4fba0cf0fb4de6841cab2 Mon Sep 17 00:00:00 2001 From: Basem Emara Date: Sat, 19 Oct 2019 18:03:22 -0400 Subject: [PATCH] Minor code convention and comment fixes --- .../Application/ApplicationPluggableDelegate.swift | 5 ++++- Sources/ZamzamCore/Extensions/CLLocationManager.swift | 4 ++-- Sources/ZamzamUI/Scene/AppRoutable.swift | 6 ------ 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/Sources/ZamzamCore/Application/ApplicationPluggableDelegate.swift b/Sources/ZamzamCore/Application/ApplicationPluggableDelegate.swift index 08afef91..88d8ba89 100644 --- a/Sources/ZamzamCore/Application/ApplicationPluggableDelegate.swift +++ b/Sources/ZamzamCore/Application/ApplicationPluggableDelegate.swift @@ -49,7 +49,10 @@ import UIKit open class ApplicationPluggableDelegate: UIResponder, UIApplicationDelegate { public var window: UIWindow? + /// List of application plugins for binding to `AppDelegate` events public private(set) lazy var plugins: [ApplicationPlugin] = { application() }() + + /// List of application plugins for binding to `AppDelegate` events open func application() -> [ApplicationPlugin] {[]} // Override } @@ -113,7 +116,7 @@ extension ApplicationPluggableDelegate { } } -/// Conforming to an app module and added to `AppDelegate.plugins()` will trigger events. +/// Conforming to an app module and added to `AppDelegate.application()` will trigger events. public protocol ApplicationPlugin { func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool diff --git a/Sources/ZamzamCore/Extensions/CLLocationManager.swift b/Sources/ZamzamCore/Extensions/CLLocationManager.swift index b19c62f9..1e7cb0fd 100644 --- a/Sources/ZamzamCore/Extensions/CLLocationManager.swift +++ b/Sources/ZamzamCore/Extensions/CLLocationManager.swift @@ -20,7 +20,7 @@ public extension CLLocationManager { statuses.append(.authorized) #endif - return CLLocationManager.locationServicesEnabled() - && CLLocationManager.authorizationStatus().within(statuses) + return Self.locationServicesEnabled() + && Self.authorizationStatus().within(statuses) } } diff --git a/Sources/ZamzamUI/Scene/AppRoutable.swift b/Sources/ZamzamUI/Scene/AppRoutable.swift index 5eaef6cd..2f399de5 100644 --- a/Sources/ZamzamUI/Scene/AppRoutable.swift +++ b/Sources/ZamzamUI/Scene/AppRoutable.swift @@ -15,13 +15,7 @@ import WatchKit public protocol AppRoutable { #if os(iOS) var viewController: UIViewController? { get set } - - func dismiss(animated: Bool, completion: (() -> Void)?) - func dismissOrPop(animated: Bool, completion: (() -> Void)?) - func close(animated: Bool, completion: (() -> Void)?) #elseif os(watchOS) var viewController: WKInterfaceController? { get set } - - func dismiss() #endif }