Created
August 1, 2013 19:14
-
-
Save UjwalManjunath/6134307 to your computer and use it in GitHub Desktop.
adding checkmark accessary to multiple sections(checking one cell at a time in each section)
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 didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ | |
[tableView cellForRowAtIndexPath:[NSIndexPath indexPathForItem:indexPath.row inSection:indexPath.section]].accessoryType = UITableViewCellAccessoryCheckmark; | |
[self deSelectOtherCellsInTableView:tableView Except:indexPath]; | |
} | |
-(void)deSelectOtherCellsInTableView:(UITableView *)tableView Except:(NSIndexPath *)indexPath{ | |
for(UITableViewCell *cell in [tableView visibleCells]){ | |
NSIndexPath *index = [tableView indexPathForCell:cell]; | |
if(index.section == indexPath.section && index.row != indexPath.row){ | |
cell.accessoryType = UITableViewCellAccessoryNone; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment