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.
52 lines
1.4 KiB
52 lines
1.4 KiB
//
|
|
// AgentTableViewCell.swift
|
|
// GMERemittance
|
|
//
|
|
// Created by FMI-12 on 2/5/18.
|
|
// Copyright © 2018 Gobal Money Express Co. Ltd. All rights reserved.
|
|
//
|
|
|
|
import UIKit
|
|
|
|
protocol AgentTableViewCellDelegate : class {
|
|
func agentTableViewCellDidTapMap(_ sender: AgentTableViewCell)
|
|
}
|
|
|
|
class AgentTableViewCell: UITableViewCell {
|
|
|
|
@IBOutlet weak var labelBranchName: UILabel!
|
|
@IBOutlet weak var labelBranchAddress: UILabel!
|
|
@IBOutlet weak var buttonPhoneNumber: UIButton!
|
|
@IBOutlet weak var buttonMap: UIButton!
|
|
|
|
weak var delegate: AgentTableViewCellDelegate?
|
|
|
|
@IBAction func initiateCall(_ sender: UIButton) {
|
|
if buttonPhoneNumber.titleLabel?.text != " "{
|
|
if let number = URL(string: "tel://" + sender.title(for: .normal)!){
|
|
if #available(iOS 10.0, *) {
|
|
UIApplication.shared.open(number, options: [:], completionHandler: nil)
|
|
} else {
|
|
// Fallback on earlier versions
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@IBAction func buttonMapTap(_ sender: UIButton) {
|
|
delegate?.agentTableViewCellDidTapMap(self)
|
|
|
|
}
|
|
|
|
override func awakeFromNib() {
|
|
super.awakeFromNib()
|
|
// Initialization code
|
|
}
|
|
|
|
override func setSelected(_ selected: Bool, animated: Bool) {
|
|
super.setSelected(selected, animated: animated)
|
|
|
|
// Configure the view for the selected state
|
|
}
|
|
|
|
}
|