Skip to content

Instantly share code, notes, and snippets.

@MaximAlien
Created December 9, 2015 22:38
Show Gist options
  • Save MaximAlien/43b71570422aa2eee2b6 to your computer and use it in GitHub Desktop.
Save MaximAlien/43b71570422aa2eee2b6 to your computer and use it in GitHub Desktop.
[iOS] Code which sets separator inset in the UITableViewCell to zero
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
if ([tableView respondsToSelector:@selector(setSeparatorInset:)])
{
[tableView setSeparatorInset:UIEdgeInsetsZero];
}
if ([tableView respondsToSelector:@selector(setLayoutMargins:)])
{
[tableView setLayoutMargins:UIEdgeInsetsZero];
}
if ([cell respondsToSelector:@selector(setLayoutMargins:)])
{
[cell setLayoutMargins:UIEdgeInsetsZero];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment