Last active
October 5, 2016 01:10
-
-
Save ronanrodrigo/42d3ffbdb1b934eadba1930a74d41f72 to your computer and use it in GitHub Desktop.
VIPER files
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
| protocol NewCustomerForm { | |
| var enteredName: String? { get } | |
| var enteredEmail: String? { get } | |
| var enteredPhone: String? { get } | |
| var enteredAddress: String? { get } | |
| } | |
| class NewCustomerViewController: UIViewController, NewCustomerForm { | |
| // MARK: Outlets | |
| @IBOutlet weak var name: UITextField! | |
| @IBOutlet weak var email: UITextField! | |
| @IBOutlet weak var phone: UITextField! | |
| @IBOutlet weak var address: UITextField! | |
| // MARK: NewCustomerForm | |
| public var enteredName: String? { return name.text } | |
| public var enteredEmail: String? { return email.text } | |
| public var enteredPhone: String? { return phone.text } | |
| public var enteredAddress: String? { return address.text } | |
| // MARK: Events | |
| func didTouchAtSaveCustomer() { | |
| // Criação de uma instância do presenter de input, o responsável | |
| // por interpretar os dados digitados no formulário. | |
| CreateCustomerInputPresenterApp(newCustomerForm: self).createCustomer() | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment