Pass variable to custom UITableViewCell from UIViewController

前端 未结 4 736
死守一世寂寞
死守一世寂寞 2021-01-20 20:59

Here is how I use my custom UITableViewCell RunningTableViewCell inside UIViewController:

func tableView(tableView: UITableView, ce         


        
4条回答
  •  别那么骄傲
    2021-01-20 21:38

    You need to override prepareForReuse in the cell. And remove it from tableView:indexPath:. So when you scroll the cell is going to be reused but the isBotton and isTop vars will be reseted.

    override func prepareForReuse() {
        self.isBottom = false
        self.isTop = false
    }
    

提交回复
热议问题