Remove UITableView separator line

Objective-C :

[self.tableView setSeparatorStyle:UITableViewCellSeparatorStyleNone];

Swift:

self.tableView.separatorStyle = UITableViewCellSeparatorStyle.None

Swift 5.0 renamed it in :

self.tableView.separatorStyle = UITableViewCell.SeparatorStyle.none

Apply the line in viewDidLoad() method.

If you want to do it from nib file, set the tableView's Separator property to None


For Swift 4:

tableView.separatorStyle = .none

For Swift 5 :

 viewDidLoad(){
     tableView.separatorStyle = UITableViewCell.SeparatorStyle.none
    }

For Objective-C :

[self.tableView setSeparatorStyle:UITableViewCellSeparatorStyleNone];

or you can use interface builder instead

enter image description here


For more information

SeparatorStyle


Hide tableView separators using UI

Here you select TableView 'Separator' property as 'None'.

https://i.stack.imgur.com/8KyH5.png