I added cells to the table and made them using xib. Now they are the full width of the table. How can I add indentation on the right and left for these cells?
I tried the following code but that didn't help.
override func awakeFromNib() {
super.awakeFromNib()
contentView.frame = frame.inset(by: UIEdgeInsets(top: 0, left: 10, bottom: 0, right: 10))
}
Make a subView within the cell give it constraints to the superView ie., the cell, then add the existing subViews to this newly added view. There are other methods too, this is the easiest I've found over the years.