Created
January 23, 2019 15:21
-
-
Save meyusufdemirci/49094f532fcc1dc06a968443a3cab8dc 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 ContactDetailTableController: UITableViewController { | |
| var presenter: ContactDetailPresenterProtocol! | |
| var contact: Contact! | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| presenter.getContact() | |
| } | |
| } | |
| extension ContactDetailTableController: ContactDetailViewProtocol { | |
| func showContact(contact: Contact) { | |
| self.contact = contact | |
| tableView.reloadData() | |
| } | |
| } | |
| extension ContactDetailTableController { | |
| override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { | |
| return 1 | |
| } | |
| override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { | |
| let cell = UITableViewCell() | |
| cell.textLabel?.text = "\(contact.fullname) - \(contact.gsm)" | |
| return cell | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment