-
-
Save anonymous/a4b54bc820ec1bd8bf36 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation ThingsViewController | |
static NSString *ThingCellIdentifier = @"ThingCell"; | |
- (ResultSetTableDataSource *)thingsDataSource | |
{ | |
if (_thingsDataSource == nil) { | |
_thingsDataSource = [[CNResultSetTableDataSource alloc] initWithAutomaticallyUpdatingResultSet:[self.thingsRepository allThings]]; | |
_thingsDataSource.cellIdentifier = ThingCellIdentifier; | |
_thingsDataSource.changeDelegate = self; | |
} | |
return _thingsDataSource; | |
} | |
#pragma mark - View lifecycle | |
- (void)viewDidLoad | |
{ | |
[super viewDidLoad]; | |
[self.tableView setDataSource:self.thingsDataSource]; | |
} | |
#pragma mark - ResultSetTableDataSourceChangesDelegate | |
- (void)dataSource:(ResultSetTableDataSource *)dataSource resultSetDidChange:(NSDictionary *)changes | |
{ | |
[self.tableView reloadData]; | |
} | |
#pragma mark - UITableViewDelegate | |
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath | |
{ | |
// Thing *thing = [self.thingsDataSource objectAtIndexPath:indexPath]; | |
// bind conversation object with cell in this method here | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment