This repository was archived by the owner on Mar 10, 2022. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11//
22// UserManager.swift
3- // BorsenMobil
3+ // UserManagerType
44//
55// Created by Jakob Mygind on 18/08/15.
6- // Copyright © 2015 Borsen . All rights reserved.
6+ // Copyright © 2015 Nodes ApS . All rights reserved.
77//
88
99import Foundation
1010import Serializable
1111import Cashier
1212
13- public typealias UserType = Serializable
14-
15- public protocol UserManagerType { }
13+ public protocol UserManagerType {
14+ associatedtype UserType : Serializable
15+ }
1616
1717public extension UserManagerType {
1818
@@ -21,7 +21,7 @@ public extension UserManagerType {
2121
2222 - Returns: Object that confroms with `UserType` with informations about the current user or `nil`.
2323 */
24- public static func currentUser< T : UserType > ( ) -> T ? {
24+ public static func currentUser( ) -> UserType ? {
2525 return NOPersistentStore . cacheWithId ( " UserManager " ) . serializableForKey ( " User " )
2626 }
2727
@@ -30,7 +30,7 @@ public extension UserManagerType {
3030
3131 - Parameter user: The user object that conforms `UserType`.
3232 */
33- public static func setCurrentUser< T : UserType > ( user: T ) {
33+ public static func setCurrentUser( user: UserType ) {
3434 NOPersistentStore . cacheWithId ( " UserManager " ) . setSerializable ( user, forKey: " User " )
3535 }
3636
You can’t perform that action at this time.
0 commit comments