forked from mirrors/linphone-iphone
UICheckBoxTableView.m: fix select/deselect tick boxes
This commit is contained in:
parent
aed4593a49
commit
77eddeea7e
1 changed files with 10 additions and 2 deletions
|
|
@ -54,8 +54,8 @@
|
|||
_emptyView.hidden = _editButton.enabled = ([self totalNumberOfItems] != 0);
|
||||
}
|
||||
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
|
||||
- (void)toggleRowSelectionForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath];
|
||||
if ([_selectedItems containsObject:indexPath]) {
|
||||
[_selectedItems removeObject:indexPath];
|
||||
} else {
|
||||
|
|
@ -65,6 +65,14 @@
|
|||
[self selectToggleButton:(_selectedItems.count != [self totalNumberOfItems])];
|
||||
}
|
||||
|
||||
- (void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
[self toggleRowSelectionForRowAtIndexPath:indexPath];
|
||||
}
|
||||
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
[self toggleRowSelectionForRowAtIndexPath:indexPath];
|
||||
}
|
||||
|
||||
- (void)selectToggleButton:(BOOL)select {
|
||||
_toggleSelectionButton.selected = select;
|
||||
if (select) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue