Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//
// objectsTableViewCell.swift
// Objekterkennung in AR mit ARKit und CoreML
//
// Created by Ufuk Kaan on 22.06.21.
//
import UIKit
import BFWControls
protocol objectsTableViewCellDelegate: AnyObject{
func didTapButton(with title: String)
}
class objectsTableViewCell: UITableViewCell {
weak var delegate: objectsTableViewCellDelegate?
static let identifier = "objectsTableViewCell"
static func nib() -> UINib{
return UINib(nibName: "objectsTableViewCell", bundle: nil)
}
@IBOutlet var button: UIButton!
private var title: String = ""
@IBAction func didTapButton(){
delegate?.didTapButton(with: title)
}
func configure(with title: String){
self.title = title
button.setTitle(title, for: .normal)
}
override func awakeFromNib() {
super.awakeFromNib()
button.setTitleColor(.link, for: .normal)
}
}