Delete border in each cell of the table in quick

I would like to remove the bottom line of each row of the question table. Another thing is that I would like to remove the left padding space in each row. How to implement it in the fast version of iOS 9.0.

enter image description here

+11
uitableview ios9 swift tablecell
source share
5 answers

You can remove the bottom border by writing this line below in viewdidLoad,

self.tblMyTable.separatorStyle = UITableViewCellSeparatorStyle.None 

And remove the left indent by writing this to cellForRow,

 cell.separatorInset = UIEdgeInsetsZero cell.layoutMargins = UIEdgeInsetsZero 

Update for Swift 3.0:

 cell?.separatorInset = UIEdgeInsets.zero cell?.layoutMargins = UIEdgeInsets.zero 
+20
source share

select tableview in storyboard and select seperator style for None enter image description here

+8
source share

Another simple solution that helped me remove the bottom lines (separators) for empty lines only - tested on Swift 4, Xcode 9 and iOS 11 :

 class viewController: UIViewController { @IBOutlet var tableView: UITableView! override func viewDidLoad() { super.viewDidLoad() tableView?.tableFooterView = UIView() } } 
+2
source share

I use the method below

 class viewController: UIViewController { @IBOutlet var tableView: UITableView! override func viewDidLoad() { super.viewDidLoad() self.tableView.separatorInset = UIEdgeInsetsMake(0, UIScreen.main.bounds.width, 0, 0) } } 
0
source share

Swift 4.2

Put the code below in viewDidLoad

tableView.separatorStyle = UITableViewCell.SeparatorStyle.none

-one
source share

All Articles