I have a button I created for a tableViewCell footer, and want to pass the section when the button is pressed, but when I print out the section, it is a completely arbitrary number, how can I pass the section Int when the button is pressed?
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
}