swift-Tableview cell UIButton background color
swift-Tableview cell UIButton background color Working on a app that has a tableview. In each cell there're two buttons(Pass/fail). If the user taps on "ok" for pass background changes green and for "!" fail, the background changes red. Issue that I'm running into is that if a button is tapped on in a row(let say the fail button). Scrolling drown to another row(like 5 rows down). fail button background color also changed(red). func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { var cell: CellTableViewCell! = tableView.dequeueReusableCell(withIdentifier: "cell") as! CellTableViewCell if cell == nil { cell = CellTableViewCell(style: UITableViewCellStyle.default, reuseIdentifier: "cell") cell.textLabel?.text = myArray[indexPath.row] cell.fail.tag = indexPath.row cell.fail.addTarget(self, action: #selector(ViewController.errorBtn(_:)), for: .touchUpIns...
