I have a tableview with a custom cell. Below image shows the view hierarchy of my tableview cell.
When adding rows to the tableview I'm hiding the 'check Image' imageview using below code.
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "accountCell", for: indexPath) as! AccountsTableViewCell
cell.checkImage.isHidden = true
return cell
}
and when a row is clicked I'm showing the imageview again. Below is the code
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let cell = tableView.dequeueReusableCell(withIdentifier: "accountCell", for: indexPath) as! AccountsTableViewCell
cell.checkImage.isHidden = false
}
But the problem is when I click a row nothing happens. system execute the cell.checkImage.isHidden = false
code line, but the imageview doesn't appear. It is still hidden. Could someone tell me what I'm doing wrong here?