Add show less item

This commit is contained in:
Roman Efimov
2013-06-04 10:38:02 -05:00
parent 7d5104bee2
commit 01b727804b

View File

@@ -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