You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.2 KiB

6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
  1. //
  2. // GmeContactsTableViewCell.swift
  3. // GMERemittance
  4. //
  5. // Created by gme_2 on 25/08/2018.
  6. // Copyright © 2018 Gobal Money Express Co. Ltd. All rights reserved.
  7. //
  8. import UIKit
  9. protocol GmeContactCallDelegate {
  10. func call(index: Int?)
  11. }
  12. class GmeContactsTableViewCell: UITableViewCell {
  13. @IBOutlet weak var titleLabel: UILabel!
  14. @IBOutlet weak var addressLabel: UILabel!
  15. @IBOutlet weak var languageLabel: UILabel!
  16. @IBOutlet weak var bgView: UIView!
  17. @IBOutlet weak var telephoneButton: UIButton!
  18. var index: Int?
  19. var contact: GmeContacts?
  20. var delegate: GmeContactCallDelegate?
  21. func setup() {
  22. self.bgView.layer.cornerRadius = 8
  23. self.titleLabel.text = contact?.title
  24. self.addressLabel.text = contact?.address
  25. self.languageLabel.text = contact?.language
  26. self.telephoneButton.setTitle((contact?.contactNumber?.joined(separator: ", ") ) ?? "", for: UIControlState.normal)
  27. self.languageLabel.isHidden = (contact?.language ?? "") == ""
  28. }
  29. @IBAction func showMap(_ sender: UIButton) {
  30. print("show on map")
  31. }
  32. @IBAction func call(_ sender: UIButton) {
  33. delegate?.call(index: self.index)
  34. }
  35. }