mirror of
https://github.com/zhigang1992/RETableViewManager.git
synced 2026-06-19 10:18:54 +08:00
Add shortcut for reloadRowsAtIndexPaths
This commit is contained in:
@@ -56,5 +56,6 @@
|
||||
- (id)initWithTitle:(NSString *)title accessoryType:(UITableViewCellAccessoryType)accessoryType selectionHandler:(void(^)(RETableViewItem *item))selectionHandler accessoryButtonTapHandler:(void(^)(RETableViewItem *item))accessoryButtonTapHandler;
|
||||
|
||||
- (NSIndexPath *)indexPath;
|
||||
- (void)reloadRowWithAnimation:(UITableViewRowAnimation)animation;
|
||||
|
||||
@end
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
#import "RETableViewItem.h"
|
||||
#import "RETableViewSection.h"
|
||||
#import "RETableViewManager.h"
|
||||
|
||||
@implementation RETableViewItem
|
||||
|
||||
@@ -79,4 +80,9 @@
|
||||
return [NSIndexPath indexPathForRow:[self.section.items indexOfObject:self] inSection:self.section.index];
|
||||
}
|
||||
|
||||
- (void)reloadRowWithAnimation:(UITableViewRowAnimation)animation
|
||||
{
|
||||
[self.section.tableViewManager.tableView reloadRowsAtIndexPaths:@[self.indexPath] withRowAnimation:animation];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -68,7 +68,8 @@
|
||||
//
|
||||
RETableViewOptionsController *optionsController = [[RETableViewOptionsController alloc] initWithItem:item options:options multipleChoice:NO completionHandler:^{
|
||||
[weakSelf.navigationController popViewControllerAnimated:YES];
|
||||
[weakSelf.tableView reloadRowsAtIndexPaths:@[item.indexPath] withRowAnimation:UITableViewRowAnimationNone];
|
||||
|
||||
[item reloadRowWithAnimation:UITableViewRowAnimationNone]; // same as [weakSelf.tableView reloadRowsAtIndexPaths:@[item.indexPath] withRowAnimation:UITableViewRowAnimationNone];
|
||||
}];
|
||||
[weakSelf.navigationController pushViewController:optionsController animated:YES];
|
||||
}];
|
||||
@@ -86,7 +87,7 @@
|
||||
// Present options controller
|
||||
//
|
||||
RETableViewOptionsController *optionsController = [[RETableViewOptionsController alloc] initWithItem:item options:options multipleChoice:YES completionHandler:^{
|
||||
[weakSelf.tableView reloadRowsAtIndexPaths:@[item.indexPath] withRowAnimation:UITableViewRowAnimationNone];
|
||||
[item reloadRowWithAnimation:UITableViewRowAnimationNone]; // same as [weakSelf.tableView reloadRowsAtIndexPaths:@[item.indexPath] withRowAnimation:UITableViewRowAnimationNone];
|
||||
NSLog(@"%@", item.value);
|
||||
}];
|
||||
[weakSelf.navigationController pushViewController:optionsController animated:YES];
|
||||
|
||||
Reference in New Issue
Block a user