mirror of
https://github.com/zhigang1992/RETableViewManager.git
synced 2026-06-18 15:39:08 +08:00
Update example project
This commit is contained in:
@@ -24,6 +24,13 @@
|
||||
_manager = [[RETableViewManager alloc] init];
|
||||
_manager.style.textFieldPositionOffset = CGSizeMake(0, 0);
|
||||
|
||||
// Set delegate and datasource
|
||||
//
|
||||
self.tableView.dataSource = _manager;
|
||||
self.tableView.delegate = _manager;
|
||||
|
||||
// Add sections and items
|
||||
//
|
||||
RETableViewSection *section = [[RETableViewSection alloc] initWithHeaderTitle:@"Basic controls"];
|
||||
[_manager addSection:section];
|
||||
|
||||
@@ -67,11 +74,6 @@
|
||||
[section addItem:[REStringItem itemWithTitle:@"Accessory 2" accessoryType:UITableViewCellAccessoryCheckmark actionBlock:^(RETableViewItem *item) {
|
||||
[weakSelf.tableView deselectRowAtIndexPath:item.indexPath animated:YES];
|
||||
}]];
|
||||
|
||||
// Set delegate and datasource
|
||||
//
|
||||
self.tableView.dataSource = _manager;
|
||||
self.tableView.delegate = _manager;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -20,13 +20,20 @@
|
||||
{
|
||||
[super viewDidLoad];
|
||||
self.title = @"RETableViewManager";
|
||||
RootViewController __weak *weakSelf = self;
|
||||
__typeof (&*self) __weak weakSelf = self;
|
||||
|
||||
// Create manager
|
||||
//
|
||||
_manager = [[RETableViewManager alloc] init];
|
||||
_manager.delegate = self;
|
||||
|
||||
// Set delegate and datasource
|
||||
//
|
||||
self.tableView.dataSource = _manager;
|
||||
self.tableView.delegate = _manager;
|
||||
|
||||
// Add sections and items
|
||||
//
|
||||
RETableViewSection *section = [[RETableViewSection alloc] init];
|
||||
[_manager addSection:section];
|
||||
|
||||
@@ -37,11 +44,6 @@
|
||||
[section addItem:[REStringItem itemWithTitle:@"List" accessoryType:UITableViewCellAccessoryDisclosureIndicator actionBlock:^(RETableViewItem *item) {
|
||||
[weakSelf.navigationController pushViewController:[[ListViewController alloc] initWithStyle:UITableViewStylePlain] animated:YES];
|
||||
}]];
|
||||
|
||||
// Set delegate and datasource
|
||||
//
|
||||
self.tableView.dataSource = _manager;
|
||||
self.tableView.delegate = _manager;
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
||||
Reference in New Issue
Block a user