0

Implemented Programmatically Custom Cell

I am trying to set space between cells but this code is not working for me

override func layoutSubviews() {
    super.layoutSubviews()
    let padding = UIEdgeInsets(top: 0, left: 0, bottom: 10, right: 0)
    bounds = bounds.inset(by: padding)
}
Jawad Ali
  • 13,556
  • 3
  • 32
  • 49
Umer Khan
  • 193
  • 12

1 Answers1

1

Better approach is the most simple way that make your cells height a bit bigger(3pt from top and 7pt from the bottom) than that of your cell's Total height, and making the colour as [UIColor clearColor]. That would give the illusion that the cells have a 10 pt gap in between.

OR

Add UIView() of 10 height at the end and give it clear color it show space between two cells

Jawad Ali
  • 13,556
  • 3
  • 32
  • 49