From 722777722e5622aa7644378b480c15925048f1b4 Mon Sep 17 00:00:00 2001 From: Ryan Khalili Date: Wed, 9 Nov 2016 02:49:23 -0800 Subject: [PATCH] Discardable return values for set and remove methods. --- Simple-KeychainSwift/Classes/Keychain.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Simple-KeychainSwift/Classes/Keychain.swift b/Simple-KeychainSwift/Classes/Keychain.swift index e1d030c..5d19433 100644 --- a/Simple-KeychainSwift/Classes/Keychain.swift +++ b/Simple-KeychainSwift/Classes/Keychain.swift @@ -11,7 +11,7 @@ import Foundation // MARK: - *** Public methods *** public class Keychain { - public class func set(_ value:String, forKey key:String) -> Bool { + @discardableResult public class func set(_ value:String, forKey key:String) -> Bool { if valueExists(forKey: key) { return update(value, forKey: key) } else { @@ -19,7 +19,7 @@ public class Keychain { } } - public class func set(_ bool:Bool, forKey key:String) -> Bool { + @discardableResult public class func set(_ bool:Bool, forKey key:String) -> Bool { let value = bool ? "true" : "false" return set(value, forKey: key) } @@ -34,7 +34,7 @@ public class Keychain { return value(forKey: key) == "true" } - public class func removeValue(forKey key:String) -> Bool { + @discardableResult public class func removeValue(forKey key:String) -> Bool { return deleteValue(forKey: key) }