要运行示例项目,请克隆仓库名,然后首先在 Example 目录下运行 pod install
。
iOS 7.1
使用 Cell & CellSource 模板 来简化您的实现。
@implementation ImoReadmeViewController
- (void)viewDidLoad
{
[super viewDidLoad];
NSMutableArray *tableSection = [NSMutableArray new];
for (int i = 0; i < 100; i++) {
ImoReadmeCellSource *source = [ImoReadmeCellSource new];
/*
In this case we have static height for cell, but if you want you can use autolayout
for in your cell and then the height of the cell will be automaticaly caluculated.
*/
source.staticHeightForCell = 45;
/*
Generate a random name
*/
source.title = [LoremIpsum name];
/*
IBOutlet from your tableView wich need to be ImoDynamicTableView class
*/
[tableSection addObject:source];
}
[self.tableView.source addObject:tableSection];
}
@end
Borinschi Ivan,[email protected]
ImoDynamicTableView 在 MIT 许可证下可用。有关更多信息,请参阅 LICENSE 文件。