TableView ReparatorInset Width - Swift 4 Without Storyboard

21 Views Asked by At

I'm trying to design an app with the width of the separatorInset being short. I can achieve that but the label in the cell gets short also.

tableView.separatorInset = UIEdgeInsets(top: 0, left: 205, bottom: 0, right: 10)

Is it possble to target the actual separatorInset only and not to width of the row? The label should not be affected. I only need to shorten the separator.

Result expected:

enter image description here

1

There are 1 best solutions below

1
Mosbah On

Your best bet is to use custom cells and to have a UIView with 1px height as separator.