为您的 iOS 应用提供可重用的数据源模型,灵感来源于更轻量级的视图控制器趋势。
要运行示例项目;克隆仓库,然后运行 pod install
,然后打开 AEFDataSource.xcworkspace
。
支持数组项或支持节的多维数组项的UITableView数据源。
NSArray *items = @[@[@"Row", @"Row"], @[@"Row", @"Row"]];
self.dataSource = [[AEFTableViewDataSource alloc] initWithItems:items
cellIdentifier:@"Cell"
configureCellBlock:^(UITableViewCell *cell, id item, NSIndexPath *indexPath) {
cell.textLabel.text = [NSString stringWithFormat:@"%@_%i", item, indexPath.row];
}];
self.tableView.dataSource = self.dataSource;
请参阅示例应用以获取更深入的使用示例。
Alex Fish, [email protected]
AEFDataSource 在 MIT 许可下可用。有关更多信息,请参阅 LICENSE 文件。