Making UITableViewCells separator go all the screen width in Swift

Subscribe to my newsletter and never miss my upcoming articles

Hello guys Leo here,

Today will be a quick tip because "no time" constraints. And the reason for the imagem it's because is a table... got it?

Let's go.


You want the UITableViewCell separator go all width of the screen.

You can notice that the default insets for UITableViewCells start a little way from the left edge of the screen.

But you can make it start from the beginning just adding this to your UITableView object:

myTableView.layoutMargins =
myTableView.separatorInset =

And also add this to your cellForRowAt :

cell.layoutMargins =


Any thoughts or comments please share below.

Thanks for the reading and... That's all folks!

Credits: image

No Comments Yet