Skip to content

Instantly share code, notes, and snippets.

@maail
Created September 30, 2014 12:03
Show Gist options
  • Save maail/2558084f7aa43c99796a to your computer and use it in GitHub Desktop.
Save maail/2558084f7aa43c99796a to your computer and use it in GitHub Desktop.
Set UITableViews Separator Insets to Zero in iOS8
func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) {
if(self.tableView.respondsToSelector(Selector("setSeparatorInset:"))){
self.tableView.separatorInset = UIEdgeInsetsZero
}
if(self.tableView.respondsToSelector(Selector("setLayoutMargins:"))){
self.tableView.layoutMargins = UIEdgeInsetsZero
}
if(cell.respondsToSelector(Selector("setLayoutMargins:"))){
cell.layoutMargins = UIEdgeInsetsZero
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment