diff --git a/Cartfile.resolved b/Cartfile.resolved index 217ac9d..16a25ae 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,3 +1,3 @@ -github "nodes-ios/Cashier" "208fb0ad06d8294b94412766d2986097f00093a6" -github "nodes-ios/Serializable" "194c00e17482b73cec2805eb2ef51a24e63311ef" -github "nodes-ios/Cashier-Serializable" "59cd3208e8f5b5bc77e8e9929b4bfd2d3d8c2bc2" +github "nodes-ios/Cashier" "8595e5f532f7f1d147040b4e234fb62bfcc60106" +github "nodes-ios/Serializable" "cb916b939f2b4ca5c771fde8ebc0ee948c006ff7" +github "nodes-ios/Cashier-Serializable" "2f3d8ebe81382e7c44d7fd5f825e76e9fc55ce1d" diff --git a/UserManagerType/UserManagerType.swift b/UserManagerType/UserManagerType.swift index 772fbb6..bc408b1 100644 --- a/UserManagerType/UserManagerType.swift +++ b/UserManagerType/UserManagerType.swift @@ -23,7 +23,7 @@ public extension UserManagerType { - Returns: Object that confroms with `UserType` with informations about the current user or `nil`. */ public static func currentUser() -> T? { - return NOPersistentStore(id: "UserManager").serializableForKey("User") + return NOPersistentStore.cacheWithId("UserManager").serializableForKey("User") } /** @@ -32,12 +32,12 @@ public extension UserManagerType { - Parameter user: The user object that conforms `UserType`. */ public static func setCurrentUser(user:T) { - NOPersistentStore(id: "UserManager").setSerializable(user, forKey: "User") + NOPersistentStore.cacheWithId("UserManager").setSerializable(user, forKey: "User") } /// Logout current user and set the object with the key `User` to nil. public static func logoutCurrentUser() { - NOPersistentStore(id: "UserManager").setObject(nil, forKey: "User") + NOPersistentStore.cacheWithId("UserManager").setObject(nil, forKey: "User") } /// Logout current user, call `logoutCurrentUser` and set token to nil. @@ -52,7 +52,7 @@ public extension UserManagerType { - Parameter token: Token as an optional `String`. */ public static func setToken(token token:String?) { - NOPersistentStore(id: "UserManager").setObject(token, forKey: "Token") + NOPersistentStore.cacheWithId("UserManager").setObject(token, forKey: "Token") } /** @@ -61,7 +61,7 @@ public extension UserManagerType { - Returns: Token as an optional `String`. */ public static func token() -> String? { - return NOPersistentStore(id: "UserManager").objectForKey("Token") as? String + return NOPersistentStore.cacheWithId("UserManager").objectForKey("Token") as? String } /** @@ -70,7 +70,7 @@ public extension UserManagerType { - Returns: `Boolean` */ public static func isLoggedIn() -> Bool { - if !NOPersistentStore(id: "UserManager").objectForKeyIsValid("User") { return false } + if !NOPersistentStore.cacheWithId("UserManager").objectForKeyIsValid("User") { return false } guard let _ = token() else { return false } return true }