Guest User

Untitled

a guest
Feb 9th, 2019
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. // MARK: LoginViewController
  2.  
  3. class LoginViewController: UIViewController {
  4.  
  5. func login(with username: String,
  6. password: String) {
  7. let authenticationSession = AuthenticationSession()
  8. authenticationSession.performLogin(with: username,
  9. password: password,
  10. completion: { userIdentifier in
  11. // Handle the login with userIdentifier
  12.  
  13. })
  14. }
  15. }
  16.  
  17. // MARK: AuthenticationSession
  18.  
  19. class AuthenticationSession {
  20.  
  21. func performLogin(with username: String,
  22. password: String,
  23. completion: ((String) -> Void)) {
  24. let userIdentifier = "12345" //Service.login(username, password)
  25. completion(userIdentifier)
  26. }
  27. }
Add Comment
Please, Sign In to add comment