Last active
June 24, 2018 06:17
-
-
Save MartinP7r/755e5b368a3e7ef594da4c1016e96c7d to your computer and use it in GitHub Desktop.
medium_post_03
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Authenticator { | |
let userDataService = UserDataService() | |
func auth(using signInService: SignInService, | |
_ completion: @escaping (_ user: User?) -> Void) { | |
signInService.signIn { token in | |
userDataService.load(forToken: token) { user in | |
completion(user) // note: error handling omitted for brevity | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment