I am trying to delete a single separator in a tableView. I have annotated the screenshot below to show this. I am wanting to delete the first cells top separator. My top text & search bar is in the tableView's header. How would I achieve this?
Asked
Active
Viewed 104 times
1
-
Hey, Can you please share your code for more help, How to create search bar and cells? – Vivek Jul 08 '19 at 04:16
3 Answers
1
Please try with this code
Original answer for this code is @Avinash
For mode detail please check avinash answer
if indexPath.row == {your row number} {
cell.separatorInset = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: .greatestFiniteMagnitude)
}

Vivek
- 4,916
- 35
- 40
-
Hi! This code turns the 1st cells bottom separator off. The top is still there... – mink23 Jul 06 '19 at 11:36
-
Cells only have a bottom separator as far as I'm aware, are you sure this line is not created by the searchBar? – David Henry Jul 06 '19 at 12:06
-
@DavidLintin Does the TableView header have a separator? How could I turn that off? – mink23 Jul 07 '19 at 00:59
0
Add a separator view (UIView) as part of your Custom cell. From the nib make the separator for UITableView to none.

fazeel ahamed
- 84
- 6