Skip to content
This repository has been archived by the owner on Mar 10, 2022. It is now read-only.

Commit

Permalink
Fixed break because of Cashier renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperwelner committed Mar 14, 2016
1 parent 5ff9f46 commit 27c2fca
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -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"
12 changes: 6 additions & 6 deletions UserManagerType/UserManagerType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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:UserType>() -> T? {
return NOPersistentStore(id: "UserManager").serializableForKey("User")
return NOPersistentStore.cacheWithId("UserManager").serializableForKey("User")
}

/**
Expand All @@ -32,12 +32,12 @@ public extension UserManagerType {
- Parameter user: The user object that conforms `UserType`.
*/
public static func setCurrentUser<T:UserType>(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.
Expand All @@ -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")
}

/**
Expand All @@ -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
}

/**
Expand All @@ -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
}
Expand Down

0 comments on commit 27c2fca

Please sign in to comment.