【发布时间】:2018-03-04 20:20:34
【问题描述】:
我需要检测UITableViewController中的按钮是否被点击
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let LikesBtn = cell.viewWithTag(7) as! UIButton
}
【问题讨论】:
-
见stackoverflow.com/a/55975789/1271826。而且,FWIW,我建议避免使用神秘的标签号码。将您的按钮连接到有意义的
@IBOutlet和@IBAction名称。
标签: ios swift uitableview