Skip to content

Instantly share code, notes, and snippets.

@meyusufdemirci
Created January 23, 2019 15:21
Show Gist options
  • Select an option

  • Save meyusufdemirci/49094f532fcc1dc06a968443a3cab8dc to your computer and use it in GitHub Desktop.

Select an option

Save meyusufdemirci/49094f532fcc1dc06a968443a3cab8dc to your computer and use it in GitHub Desktop.
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