AEFDataSource 0.4.0

AEFDataSource 0.4.0

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
发布最新发布2015年3月

Alex Fish 维护。



  • Alex Fish

为您的 iOS 应用提供可重用的数据源模型,灵感来源于更轻量级的视图控制器趋势。

使用

要运行示例项目;克隆仓库,然后运行 pod install,然后打开 AEFDataSource.xcworkspace

数据源

AEFTableViewDataSource

支持数组项或支持节的多维数组项的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 文件。