mirror of
https://github.com/zhigang1992/RETableViewManager.git
synced 2026-06-11 16:30:26 +08:00
Add show less item
This commit is contained in:
@@ -32,6 +32,13 @@
|
||||
[weakSelf.section addItemsFromArray:expandedItems];
|
||||
[weakSelf.tableView reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationAutomatic];
|
||||
}];
|
||||
|
||||
RETableViewItem *showLessItem = [RETableViewItem itemWithTitle:@"Show Less" accessoryType:UITableViewCellAccessoryDisclosureIndicator selectionHandler:^(RETableViewItem *item) {
|
||||
[weakSelf.tableView deselectRowAtIndexPath:item.indexPath animated:YES];
|
||||
[weakSelf.section removeAllItems];
|
||||
[weakSelf.section addItemsFromArray:collapsedItems];
|
||||
[weakSelf.tableView reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationAutomatic];
|
||||
}];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user