Skip to content

Instantly share code, notes, and snippets.

@LiewJunTung
Created April 8, 2019 05:00
Show Gist options
  • Save LiewJunTung/f0fd17cbae25ec40ccccd2f202943309 to your computer and use it in GitHub Desktop.
Save LiewJunTung/f0fd17cbae25ec40ccccd2f202943309 to your computer and use it in GitHub Desktop.
import UIKit
import app
class ViewController: UIViewController, LoginView {
var presenter: LoginPresenter? = nil
@IBOutlet weak var textView: UILabel!
@IBOutlet weak var editText: UITextField!
@IBAction func clickSubmitButton(_ sender: Any) {
presenter?.processLogin(password: editText.text ?? "")
}
func loginResult(result: Bool) {
if (result){
textView.text = "Login Successful"
} else {
textView.text = "Login Failed"
}
}
override func viewDidLoad() {
super.viewDidLoad()
presenter = LoginPresenterImpl(loginView: self)
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
}
@IBOutlet weak var label: UILabel!
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment