【发布时间】:2020-07-21 21:22:25
【问题描述】:
我有一个为tableViewCell页脚创建的按钮,并且想在按下按钮时传递该部分,但是当我打印出该部分时,它是一个完全任意的数字,当按钮被按下了吗?
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
let button = UIButton()
button.setTitle("Add Set", for: .normal)
button.backgroundColor = UIColor.lightGray
button.layer.cornerRadius = 5
button.addTarget(self, action: #selector(CurrentSessionVC.addSetPressed(section:)), for: .touchUpInside)
return button
}
@objc func addSetPressed(section: Int){
//prints 4349567072
}
【问题讨论】:
标签: ios swift uitableview tableview