1

How can I hide or remove the very first line separator of the tableViewCell programmatically?

I just need to remove cell 0 top line.

Something of this nature:

if(indexPath.row == 0){
   //remove top seperator
}

enter image description here

husharoonie
  • 431
  • 1
  • 4
  • 19
  • Does this answer your question? [Hide separator line on one UITableViewCell](https://stackoverflow.com/questions/8561774/hide-separator-line-on-one-uitableviewcell) – jnpdx Feb 22 '21 at 23:08

1 Answers1

3

Within your cellForRowAt delegate function you can use:

if indexPath.row == 0 {
        cell?.separatorInset = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: .greatestFiniteMagnitude)
    }
treazon
  • 56
  • 6