测试已测试 | ✗ |
语言语言 | Obj-CObjective C |
许可 | MIT |
发布最新发布 | 2014年12月 |
由Jonas Stubenrauch、Wolfgang Frank维护。
ARGenericTableViewController框架提供了通过面向对象方法创建具有不同cell类型的表格的更高灵活性。
ARGenericTableViewController是一个iOS组件,用于配置TableView。就像Storyboard中的静态TableView一样,您可以使用代码轻松配置具有许多不同Cell类的复杂TableView。TableView的分区和单元格由表示所有信息的普通对象表示,这些信息用于布局TableView和对用户事件做出反应。
您可以通过修改对象来更改TableView的内容。当然,这些更改可以是动画的。所有TableView委托和dataSource协议方法都为您实现。
请享受这个框架!
创建ARGenericTableViewController
的子类(也可以直接使用ARGenericTableViewController
)
创建一个表示整个TableView的ARTableViewData
对象
创建并配置一个ARSectionData
对象,并将其添加到ARTableViewData
对象中,使用addSectionData:
方法
创建并配置一个ARCellData
对象,并将其添加到ARSectionData
对象中,使用addCellData:
方法
设置ARGenericTableViewController
的tableViewData
属性。这将自动刷新TableView
ARTableViewData *tableViewData = [[ARTableViewData alloc] init];
ARSectionData *sectionData = [[ARSectionData alloc] init];
sectionData.headerTitle = @"Header";
[tableViewData addSectionData:sectionData];
ARCellData *cellData = [[ARCellData alloc] initWithIdentifier:@"Cell"];
cellData.editable = YES;
cellData.heigth = 44;
[cellData setCellConfigurationBlock:^(UITableViewCell *cell) {
// called in cellForRowAtIndexPath
cell.textLabel.text = [NSString stringWithFormat:@"Cell %d", i];
}];
[cellData setCellSelectionBlock:^(UITableView *tableView, NSIndexPath *indexPath) {
// called in didSelectRowAtIndexPath
UIAlertView *alert = [[UIAlertView alloc] init];
alert.title = [NSString stringWithFormat:@"Cell %d", i];
[alert addButtonWithTitle:@"OK"];
[alert show];
}];
[sectionData addCellData:cellData];
// tableViewData property is provided by ARGenericTableViewController
self.tableViewData = tableViewData;
版权所有 (c) 2013 arconsis IT-Solutions GmbH(《http://www.arconsis.com》)
以下情况下,任何人都可以免费获得本软件及其相关文档(“软件”)的副本,用于处理软件而无需进行限制,包括但不限于使用、复制、修改、合并、发布、分发、转让和/或销售软件的副本,以及其他向提供软件的人提供使用本软件的权限,但须遵守以下条件
本软件的版权声明和许可声明应包含在软件的所有副本或主要部分中。
软件按“原样”提供,不提供任何明示或暗示的担保,包括但不限于适用性、针对特定目的的适合性和非侵权性担保。在没有任何事件发生的情况下,包括但不仅限于合同行为、侵权或其他行为,不得因软件或其使用或其他处置而引起的索赔、损害或其他责任,作者或版权所有者不承担任何责任。