From a65edbc5df70b5096cba03f0b8ce18d3324b3ca9 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Mon, 15 Apr 2019 13:08:20 -0400 Subject: [PATCH] waring fix --- .../Categories/Dictionary+MFConvenience.swift | 34 +++++++++---------- .../Categories/NSNumber+Extension.swift | 2 +- .../Utility/Helpers/MVMCoreActionUtility.h | 4 +-- .../Utility/Helpers/MVMCoreDispatchUtility.h | 2 +- .../MVMCoreGetterUtility+Extension.swift | 4 +-- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/MVMCore/MVMCore/Categories/Dictionary+MFConvenience.swift b/MVMCore/MVMCore/Categories/Dictionary+MFConvenience.swift index fa54073..cab84d0 100644 --- a/MVMCore/MVMCore/Categories/Dictionary+MFConvenience.swift +++ b/MVMCore/MVMCore/Categories/Dictionary+MFConvenience.swift @@ -11,7 +11,7 @@ import Foundation public extension Dictionary { /// Returns a Dictionary using the specified chain. An empty dictionary is returned if a dictionary for the chain does not exist - public func dictionaryWithChainOfKeysOrIndexes(_ keysOrIndexes: [Any]) -> [String : Any] { + func dictionaryWithChainOfKeysOrIndexes(_ keysOrIndexes: [Any]) -> [String : Any] { guard let dictionary = optionalDictionaryWithChainOfKeysOrIndexes(keysOrIndexes) else { return [:] @@ -20,18 +20,18 @@ public extension Dictionary { } /// Returns an optional Dictionary using the specified chain. Returns nil if a dictionary for the chain does not exist - public func optionalDictionaryWithChainOfKeysOrIndexes (_ keysOrIndexes: [Any]) -> [String : Any]? { + func optionalDictionaryWithChainOfKeysOrIndexes (_ keysOrIndexes: [Any]) -> [String : Any]? { return objectChainOfKeysOrIndexes(keysOrIndexes) as? [String: Any] } - public func optionalDictionaryForKey(_ key: String) -> [String : Any]? { + func optionalDictionaryForKey(_ key: String) -> [String : Any]? { return objectChainOfKeysOrIndexes([key]) as? [String: Any] } /// Returns a String using the specified chain. An empty string is returned if a string for the chain does not exist - public func stringWithChainOfKeysOrIndexes(_ keysOrIndexes:[Any]) -> String { + func stringWithChainOfKeysOrIndexes(_ keysOrIndexes:[Any]) -> String { guard let string = objectChainOfKeysOrIndexes(keysOrIndexes) as? String else { return "" @@ -39,12 +39,12 @@ public extension Dictionary { return string } - public func stringOptionalWithChainOfKeysOrIndexes(_ keysOrIndexes:[Any]) -> String? { + func stringOptionalWithChainOfKeysOrIndexes(_ keysOrIndexes:[Any]) -> String? { return objectChainOfKeysOrIndexes(keysOrIndexes) as? String } /// Returns an Array using the specified chain. Returns an empty array if an array for the chain does not exist - public func arrayForChainOfKeysOrIndexes(_ keysOrIndexes: [Any]) -> [Any] { + func arrayForChainOfKeysOrIndexes(_ keysOrIndexes: [Any]) -> [Any] { guard let array = objectChainOfKeysOrIndexes(keysOrIndexes) as? [Any] else { return [] @@ -53,31 +53,31 @@ public extension Dictionary { } /// Returns a Dictionary after looking up the specified key. An empty dictionary is returned if a dictionary for the key does not exist - public func dictionaryForKey(_ key : String) -> [String : Any] { + func dictionaryForKey(_ key : String) -> [String : Any] { return dictionaryWithChainOfKeysOrIndexes([key]) } /// Returns a String after looking up the specified key. An empty string will be returned if a string for the key does not exist - public func stringForkey(_ key: String) -> String { + func stringForkey(_ key: String) -> String { return stringWithChainOfKeysOrIndexes([key]) } /// Returns a String after looking up the specified key. Nil will be returned if a string for the key does not exist - public func optionalStringForKey(_ key: String) -> String? { + func optionalStringForKey(_ key: String) -> String? { return objectChainOfKeysOrIndexes([key]) as? String } /// Returns an Array after looking up the specified key. An empty array will be returned if an array for the key does not exist - public func arrayForKey(_ key : String) -> [Any] { + func arrayForKey(_ key : String) -> [Any] { return arrayForChainOfKeysOrIndexes([key]) } /// Return a Bool after looking up the specified key. This will return false if the key does not exist - public func boolForKey(_ key : String) -> Bool { + func boolForKey(_ key : String) -> Bool { guard let bool = objectChainOfKeysOrIndexes([key]) as? Bool else { return false @@ -86,7 +86,7 @@ public extension Dictionary { } /// Return a Bool after looking up the specified key. This will return false if the key does not exist - public func optionalBoolForKey(_ key : String) -> Bool? { + func optionalBoolForKey(_ key : String) -> Bool? { guard let bool = objectChainOfKeysOrIndexes([key]) as? Bool else { return nil @@ -94,7 +94,7 @@ public extension Dictionary { return bool } - public func lenientBoolForKey(_ key: String) -> Bool { + func lenientBoolForKey(_ key: String) -> Bool { guard let key = key as? Key, let object = self[key] else { return false } @@ -106,7 +106,7 @@ public extension Dictionary { return false } - public func boolForChainOfKeysOrIndexes(_ keysOrIndexes:[Any])-> Bool { + func boolForChainOfKeysOrIndexes(_ keysOrIndexes:[Any])-> Bool { guard let bool = objectChainOfKeysOrIndexes(keysOrIndexes) as? Bool else { return false } @@ -114,7 +114,7 @@ public extension Dictionary { } /// Return a float from a string created by looking up the specified key. This will return 0.0 if the key does not exist - public func floatForKey(_ key: String) -> Float { + func floatForKey(_ key: String) -> Float { guard let floatValue = objectChainOfKeysOrIndexes([key]) as? Float else { return 0.0 @@ -123,7 +123,7 @@ public extension Dictionary { return floatValue } - public func floatFromStringForKey(_ key:String) -> Float { + func floatFromStringForKey(_ key:String) -> Float { let stringValue = stringForkey(key) @@ -135,7 +135,7 @@ public extension Dictionary { } - public func int32ForKey(_ key:String) -> Int32 { + func int32ForKey(_ key:String) -> Int32 { guard let intValue = objectChainOfKeysOrIndexes([key]) as? Int32 else { return 0 diff --git a/MVMCore/MVMCore/Categories/NSNumber+Extension.swift b/MVMCore/MVMCore/Categories/NSNumber+Extension.swift index d2621bc..3817ec4 100644 --- a/MVMCore/MVMCore/Categories/NSNumber+Extension.swift +++ b/MVMCore/MVMCore/Categories/NSNumber+Extension.swift @@ -9,7 +9,7 @@ import Foundation public extension NSNumber { - public func cgfloat() -> CGFloat { + func cgfloat() -> CGFloat { return CGFloat(doubleValue) } } diff --git a/MVMCore/MVMCore/Utility/Helpers/MVMCoreActionUtility.h b/MVMCore/MVMCore/Utility/Helpers/MVMCoreActionUtility.h index 6e7f4ef..bdb0abd 100644 --- a/MVMCore/MVMCore/Utility/Helpers/MVMCoreActionUtility.h +++ b/MVMCore/MVMCore/Utility/Helpers/MVMCoreActionUtility.h @@ -24,9 +24,9 @@ + (void)displayViewController:(nonnull UIViewController *)viewController forLoadObject:(nullable MVMCoreLoadObject *)loadObject presentationDelegate:(nullable NSObject*)delegate completionHandler:(nullable void (^)(void))completionBlock; // returns if the class is not the same or a subclass of the other class. Can pass throw an exception as well -+ (BOOL)classIsInstanceTypeOfClass:(Class)theClass otherClass:(Class)otherClass throwException:(BOOL)throwException; ++ (BOOL)classIsInstanceTypeOfClass:(nonnull Class)theClass otherClass:(nonnull Class)otherClass throwException:(BOOL)throwException; // Calls the above function with throw exception yes if the object is not nil. Returns the object. Convenience function for one liner in initializer. -+ (id)initializerClassCheck:(nullable NSObject *)object classToVerify:(Class)classToVerify; ++ (nonnull id)initializerClassCheck:(nullable NSObject *)object classToVerify:(nonnull Class)classToVerify; @end diff --git a/MVMCore/MVMCore/Utility/Helpers/MVMCoreDispatchUtility.h b/MVMCore/MVMCore/Utility/Helpers/MVMCoreDispatchUtility.h index 982ed5d..c49445e 100644 --- a/MVMCore/MVMCore/Utility/Helpers/MVMCoreDispatchUtility.h +++ b/MVMCore/MVMCore/Utility/Helpers/MVMCoreDispatchUtility.h @@ -19,6 +19,6 @@ + (void)performSyncBlockInBackground:(nonnull void (^)(void))block; /// Ensures the block is peformed on the same *labeled* dispatch queue. The queue *must* be previously initialized with a unique label. -+ (void)performSyncBlock:(nonnull void (^)(void))block onQueue:(dispatch_queue_t)queue; ++ (void)performSyncBlock:(nonnull void (^)(void))block onQueue:(nonnull dispatch_queue_t)queue; @end diff --git a/MVMCore/MVMCore/Utility/Helpers/MVMCoreGetterUtility+Extension.swift b/MVMCore/MVMCore/Utility/Helpers/MVMCoreGetterUtility+Extension.swift index 835c0fb..e37b2b5 100644 --- a/MVMCore/MVMCore/Utility/Helpers/MVMCoreGetterUtility+Extension.swift +++ b/MVMCore/MVMCore/Utility/Helpers/MVMCoreGetterUtility+Extension.swift @@ -9,11 +9,11 @@ import Foundation public extension MVMCoreGetterUtility { - public class func fequal(a: Float ,b: Float) -> Bool { + class func fequal(a: Float ,b: Float) -> Bool { return (abs((a) - (b)) < Float.ulpOfOne) } - public class func cgfequal(_ a: CGFloat ,_ b: CGFloat) -> Bool { + class func cgfequal(_ a: CGFloat ,_ b: CGFloat) -> Bool { return (abs((a) - (b)) < CGFloat.ulpOfOne) } }