Instead of the default selectionStyle where the background view changes color I'm trying to just change the color of a UIView which I've added to the guideViewCell. However, when deselecting the cell or pressing another cell it doesn't seem to apply the clearColor on the previous indicatorImage. I've tried to set the selectedBackgroundView to clearColor however this will hide my custom border. What can I do in order to solve this issue?
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("GuideCell", forIndexPath: indexPath) as! GuideViewCell
cell.selectionStyle = UITableViewCellSelectionStyle.None
return cell
}
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
var cell = tableView.cellForRowAtIndexPath(indexPath) as! GuideViewCell
cell.indicatorImage.backgroundColor = UIColor.blackColor()
}
func tableView(tableView: UITableView, didDeSelectRowAtIndexPath indexPath: NSIndexPath) {
var cell = tableView.cellForRowAtIndexPath(indexPath) as! GuideViewCell
cell.indicatorImage.backgroundColor = UIColor.clearColor()
}
didDeSelectRowAtIndexPathir should bedidDeselectRowAtIndexPath- 0yeoj