Last active
December 17, 2015 22:39
-
-
Save corinnekrych/5683404 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
- (ARCellData *)cellProject { | |
[self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:NSStringFromClass([UITableViewCell class])]; | |
ARCellData *cellData = [[ARCellData alloc] initWithIdentifier:NSStringFromClass([UITableViewCell class])]; | |
[cellData setCellConfigurationBlock:^(UITableViewCell *cell) { | |
//[cell setStyle:UITableViewCellStyleValue1]; | |
cell.textLabel.text = @"Project"; | |
cell.detailTextLabel.text = self.task[@"project"]; | |
}]; | |
return cellData; | |
} | |
... and internally ARGenricTableViewController | |
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath | |
{ | |
ARCellData *cellData = [self.tableViewData cellDataAtIndexPath:indexPath]; | |
NSString *CellIdentifier = cellData.identifier; | |
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; | |
if (!cell) { | |
Class TableViewClass = self.tableViewCellClassDict[CellIdentifier]; | |
cell = [[TableViewClass alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; | |
} | |
// Configure the cell... | |
if (cellData.cellConfigurationBlock) { | |
cellData.cellConfigurationBlock(cell); | |
} | |
return cell; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ARCellData *cellData = [[ARCellData alloc] initWithIdentifier:NSStringFromClass([UITableViewCell class]) andWithStyle:.....];