TableViewCell Width & TableView Width

Hi, I'm trying to get to come to grips with tableview cells. I asked in another question, but without any response so I'll try reframing the question.
Why does this first piece of code show a cell border edge that is inside the tableView


cell.layer.borderWidth = 5

cell.layer.borderColor = color



Whereas this code places the border frame way out of sight beyond the edge of the tableView. I have to subtract considerably more than the right_padding to bring it into view.


let right_border = CALayer()

let right_padding = CGFloat(4.0)

right_border.borderColor = color

right_border.frame = CGRect(x: cell.frame.size.width - right_padding, y: 0, width: right_padding, height: 70)

right_border.borderWidth = right_padding


cell.layer.addSublayer(right_border)


Is one dealing with the cell boundaries and the other not? Or is the second piece of code placing the frame outside of the cell? I don't see how it could be, but perhaps it is?

In the past, the rule was that child views took their layout control queues from the parent view.


You might want to see if there is a conflict or two etc. between those levels where one might be overriding the other.


And feel free to remove your original/other thread/question so you don't cause people to chase both, thanks.

TableViewCell Width & TableView Width
 
 
Q