// // GmeContactsTableViewCell.swift // GMERemittance // // Created by gme_2 on 25/08/2018. // Copyright © 2018 Gobal Money Express Co. Ltd. All rights reserved. // import UIKit protocol GmeContactCallDelegate: class { func call(index: Int?) } class GmeContactsTableViewCell: UITableViewCell { @IBOutlet weak var titleLabel: UILabel! @IBOutlet weak var addressLabel: UITextView! @IBOutlet weak var languageLabel: UILabel! @IBOutlet weak var bgView: UIView! @IBOutlet weak var telephoneButton: UIButton! var index: Int? var contact: GmeContacts? weak var delegate: GmeContactCallDelegate? func setup() { self.bgView.layer.cornerRadius = 8 self.titleLabel.text = contact?.title self.addressLabel.text = contact?.address self.languageLabel.text = contact?.language self.telephoneButton.setTitle( (contact?.contactNumber?.joined(separator: ", ") ) ?? "", for: .normal ) self.languageLabel.isHidden = (contact?.language ?? "") == "" } @IBAction func showMap(_ sender: UIButton) { print("show on map") } @IBAction func call(_ sender: UIButton) { delegate?.call(index: self.index) } }