Created
May 29, 2018 00:09
-
-
Save rajajawahar/118c12ae9e6cd62953bbeb1a013a26e0 to your computer and use it in GitHub Desktop.
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 LoginPresenter: BasePresenter { | |
typealias View = LoginView | |
var loginView : LoginView? | |
func attachView(view: LoginView) { | |
self.loginView = view | |
} | |
func detachView() { | |
} | |
func destroy() { | |
} | |
func emailValid(emailAddress : String) -> Bool { | |
let emailRegEx = "[A-Z0–9a-z._%+-]+@[A-Za-z0–9.-]+\\.[A-Za-z]{2,}" | |
let emailTest = NSPredicate(format:"SELF MATCHES %@", emailRegEx) | |
return emailTest.evaluate(with: emailAddress) | |
} | |
func login(username : String, password : String){ | |
//Make an API Call from the given username and password | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment