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

//
// 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 {
func call(index: Int?)
}
class GmeContactsTableViewCell: UITableViewCell {
@IBOutlet weak var titleLabel: UILabel!
@IBOutlet weak var addressLabel: UILabel!
@IBOutlet weak var languageLabel: UILabel!
@IBOutlet weak var bgView: UIView!
@IBOutlet weak var telephoneButton: UIButton!
var index: Int?
var contact: GmeContacts?
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: UIControlState.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)
}
}