I want to remove the cell separators in my UITableView
. This is how my simulator currently looks:
I have implemented the following line of code in the viewDidLoad:
method of the .swift
file of the view controller:
self.tableView.separatorStyle = UITableViewCellSeparatorStyle.None
This doesn't seem to be working though.
How do I remove the cell separators?
Here is my cellForRowAtIndexPath:
code:
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cellIdentifier = "Cell"
let cell = tableView.dequeueReusableCellWithIdentifier(cellIdentifier, forIndexPath: indexPath) as! RestaurantsTableViewCell
// Configure the cell...
cell.nameLabel.text = restaurants[indexPath.row].name
cell.typeLabel.text = restaurants[indexPath.row].type
cell.mainImageView.image = UIImage(named: restaurants[indexPath.row].image)
return cell
}