Separator lines appearing around UITableViewCell on select/highlight in iOS8

ios, ios8, swift, uitableview

Solution

I'm assuming that you are overriding setSelected and setHighlighted?

self.selectedBackgroundView.hidden = true

works for me.

It took me a while to find a solution to it as well. And this is the view hierarchy that I found for the cell:

0: class: 'UITableViewCellSelectedBackground'
0: class: 'UITableViewCellContentView'    
0: class: '_UITableViewCellSeparatorView'

The UITableViewCellSelectedBackground is setting the background. The background is then overlayed with the ContentView.

Problem

I have a very simple UITableView where I have set the separator inset style to be none: ``` tableView.separatorStyle = UITableViewCellSeparatorStyle.None ``` Running the app I get what I expect with no lines between the cells. However, when I select one of the table view cells, white lines appear around it. Why is that and can I change the appearance of it? Screenshots below: The lines shown by arrows appear on highlight. The cell colour change is intentional. Any help in the right direction would be much appreciated. I am using iOS 8.1 as target with XCode 6.1.1 I have set the background colour as follows. In viewDidLoad: ``` tableView.backgroundColor = UIColor.blackColor() tableView.alpha = 0.8 tableView.separatorStyle = UITableViewCellSeparatorStyle.None ``` In cellForRowAtIndexPath: ``` thisCell.contentView.backgroundColor = UIColor.blackColor() thisCell.contentView.alpha = 0.85 ```

Original source