EPSStaticTableViewController 1.1

EPSStaticTableViewController 1.1

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

Peter Stuart 维护。



  • Peter Stuart 和 Justin Stuart

EPSStaticTableViewControllerUITableViewController 的子类,它使设置静态内容的表格视图变得简单。

使用方法

要使用 EPSStaticTableViewController,继承它并覆盖以下方法

- (NSArray *)identifiers

在此方法中,返回一个包含 NSString 对象的数组数组。每个内部数组代表表格视图的一个部分。例如,返回

@[ @[ @"One", @"Two" ], @[ @"A" ], @[ @"X", @"Y", @"Z" ] ]

将生成一个包含三个部分、分别包含两行、一行和三行的表格视图。

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowWithIdentifier:(NSString *)identifier indexPath:(NSIndexPath *)indexPath

此方法替换了 UITableViewDelegate 方法 tableView:cellForRowAtIndexPath:,这样您就可以使用 identifier 来决定如何设置单元格,而不是使用 indexPath

- (void)tableView:(UITableView *)tableView didSelectRowWithIdentifier:(NSString *)identifier indexPath:(NSIndexPath *)indexPath

此方法替换了 UITableViewDelegate 方法 tableView:didSelectRowAtIndexPath:,这样您就可以使用 identifier 来决定要采取什么操作,而不是使用 indexPath

安装

EPSStaticTableVIewController 通过 CocoaPods 提供,要安装它,只需将以下行添加到 Podfile 中

pod "EPSStaticTableViewController"

或者,将 EPSStaticTableViewController.hEPSStaticTableViewController.m 包含到您的项目中。

许可证

EPSStaticTableViewController 在 MIT 许可证下提供。有关更多信息,请参阅 LICENSE 文件。