Update example project

This commit is contained in:
Roman Efimov
2013-03-27 16:29:00 -05:00
parent 6979b5cc09
commit 17f48151bb
2 changed files with 15 additions and 11 deletions

View File

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

View File

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