FWKeychainManager

@objcMembers
public class FWKeychainManager : NSObject

Keychain管理器

  • 单例模式

    Declaration

    Swift

    public static let sharedInstance: FWKeychainManager
  • 公用对象

    Declaration

    Swift

    public override init()
  • 分组对象

    Declaration

    Swift

    public init(group: String?)
  • 读取String数据

    Declaration

    Swift

    public func password(forService service: String?, account: String?) -> String?
  • 读取Data数据

    Declaration

    Swift

    public func passwordData(forService service: String?, account: String?) -> Data?
  • 读取Object数据

    Declaration

    Swift

    public func passwordObject(forService service: String?, account: String?) -> Any?
  • 保存String数据

    Declaration

    Swift

    @discardableResult
    public func setPassword(_ password: String, forService service: String?, account: String?) -> Bool
  • 保存Data数据

    Declaration

    Swift

    @discardableResult
    public func setPasswordData(_ passwordData: Data, forService service: String?, account: String?) -> Bool
  • 保存Object数据

    Declaration

    Swift

    @discardableResult
    public func setPasswordObject(_ passwordObject: Any, forService service: String?, account: String?) -> Bool
  • 删除数据

    Declaration

    Swift

    @discardableResult
    public func deletePassword(forService service: String?, account: String?) -> Bool