1

I have a grouped tableview and I am trying to set a border for each section in the tableview. The sections have different row count. The ones that have one row I use this code and it works great:

layer.masksToBounds = true
layer.cornerRadius = 3
layer.borderWidth = 1
let borderColor: UIColor = .black
layer.borderColor = borderColor.cgColor

I use custom cells.

The problem is when I have more than one row, each cell have its own border and I want to make the border only around the section. Any suggestions?

Thank you

Update:

here a screenshot for better explanation : screenshot

the problem is with the section that has multiple rows I want the border to wrap that section.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Kilom94l
  • 85
  • 11
  • It is hard to tell what your code is doing right now and what you expect it to do with out some images. What do you see now and what do you expect to see? – Aaron Jun 21 '18 at 16:37
  • Also, please provide the code that is supposed to be changing your "group"'s appearance and the code that is changing each cell's appearance. Its not clear at all whose `layer` is being updated by the code you've provided. – Aaron Jun 21 '18 at 16:38
  • @Aaron I updated my question. `layer` is for the custom cells. – Kilom94l Jun 21 '18 at 16:46

0 Answers0