I'm defining custom UITableViewCell
s in a storyboard. I'm also using some of the built in standard style cells. I need to set up constraints so that my custom cells match with the platform defined ones (have their titles correctly aligned at the left).
I've noticed that the left alignment of cells changes between iOS versions and the device it's running on. It seems like the left alignment is the same as the default cell separatorInset
.
Here is UITableViewCell
s separatorInset
for a few devices and iOS versions:
- iPad on 7 – 15 points.
- iPad on 8 – 20 points.
- iPhone on 7 – 15 points.
- iPhone on 8 – 16 points.
Other devices (iPhone 6+, iPad Mini) could be different – I've not exhaustively checked.
How would you go about ensuring that the custom cells and built in cells have the same left alignment of their labels?
Is there a sensible way to obtain these inset defaults and use them in auto layout constraints that are set up in a storyboard? How about in code?