Last active
August 29, 2020 13:29
-
-
Save romainbsl/afcf9c83e14d2f26abeddeef7ff3b539 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
import UIKit | |
import NBVCommon | |
class LoginViewController: UIViewController, LoginView { | |
@IBOutlet weak var login_secret: UITextField! | |
@IBOutlet weak var login_button: UIButton! | |
let presenter: LoginPresenter! = InjectorCommon.init().provideLoginPresenter() | |
override func viewWillAppear(_ animated: Bool) { | |
super.viewWillAppear(animated) | |
presenter.attachView(view: self) | |
} | |
override func viewWillDisappear(_ animated: Bool) { | |
super.viewWillDisappear(animated) | |
presenter.detachView() | |
} | |
override func loginSuccess() { | |
// Navigate to the next screen | |
} | |
override func loginFailure(l) { | |
// Show error to the user | |
} | |
@IBAction func loginButtonClick(sender: UIButton) { | |
presenter.login(secret: login_secret.text) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment