Created
December 11, 2014 16:34
-
-
Save lukewar/80c44c7e440bd6458786 to your computer and use it in GitHub Desktop.
Inset free table view separator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (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