日期单元格控制器 1.1.3

日期单元格控制器 1.1.3

测试测试
语言语言 Objective-CObjective C
许可证 MIT
发布最后发布2015 年 9 月

andjash 维护。



  • Andrey Yashnev

一个简单的 iOS 控制器,用于带有日期单元格的 UITableView

预览

Preview1 Preview2 Preview3

(查看视频: http://screencast.com/t/Vp94gyhpjUwr)

用法

导入所需的头文件

#import "DateCellsController.h"

创建 NSIndexPath 到 NSDate 的映射

NSIndexPath *path = [NSIndexPath indexPathForRow:2 inSection:0];
NSIndexPath *path2 = [NSIndexPath indexPathForRow:0 inSection:0];
NSIndexPath *path3 = [NSIndexPath indexPathForRow:0 inSection:1];


NSDate *date = [NSDate date];
NSDate *date2 = [NSDate dateWithTimeIntervalSinceNow:5000];
NSDate *date3 = [NSDate dateWithTimeIntervalSinceNow:10000];


NSMutableDictionary *indexPathToDateMapping = [[@{path : date,
                                                 path2 : date2,
                                                 path3 : date3}
                                                   mutableCopy] autorelease];

将控制器附加到现有具有正确映射的 UITableView 上

DateCellsController *dateCellsController = attachToTableView:self.tableView
                                                withDelegate:self
                                                 withMapping:indexPathToDateMapping];