Skip to content

Instantly share code, notes, and snippets.

@warriorg
Created March 12, 2016 03:21
Show Gist options
  • Save warriorg/19f1ca39144d9caf1497 to your computer and use it in GitHub Desktop.
Save warriorg/19f1ca39144d9caf1497 to your computer and use it in GitHub Desktop.
干掉UITableView 最后一个 separatorLine
override func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) {
if (indexPath.row == formList!.count - 1) {
cell.separatorInset = UIEdgeInsetsMake(0, cell.bounds.size.width, 0, 0)
return;
}
cell.separatorInset = UIEdgeInsetsZero
if #available(iOS 8.0, *) {
cell.preservesSuperviewLayoutMargins = false
cell.layoutMargins = UIEdgeInsetsZero
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment