Guest User

Untitled

a guest
Jun 1st, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. class LoginPresenter: BasePresenter {
  2.  
  3. typealias View = LoginView
  4. var loginView : LoginView?
  5.  
  6. func attachView(view: LoginView) {
  7. self.loginView = view
  8. }
  9.  
  10. func detachView() {
  11. }
  12.  
  13. func destroy() {
  14. }
  15.  
  16. func emailValid(emailAddress : String) -> Bool {
  17. let emailRegEx = "[A-Z0–9a-z._%+-]+@[A-Za-z0–9.-]+\\.[A-Za-z]{2,}"
  18. let emailTest = NSPredicate(format:"SELF MATCHES %@", emailRegEx)
  19. return emailTest.evaluate(with: emailAddress)
  20. }
  21.  
  22. func login(username : String, password : String){
  23. //Make an API Call from the given username and password
  24. }
  25.  
  26. }
Add Comment
Please, Sign In to add comment