TimelineView
TimelineView 是一个显示时间更新的最简单组件。
示例
要运行示例项目,请克隆仓库,并首先从 Example 目录运行 `pod install`。
要求
安装
Cocoapods
TimelineView 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 即可
pod 'TimelineView'
用法
添加TimelineView
在您的UIViewController中添加UIView,并将自定义类指定为TimelineView,
为该视图提供输出端口,然后将如下所示的Timeline数据传递给该视图
var darkGreen = UIColor.init(red: 2/255, green: 138/255, blue: 75/255, alpha: 1)
var lightBlack = UIColor(red:37/255, green:48/255, blue:64/255, alpha:1)
timline.timelineData = [
Timeline(title: "Order Created", timeString: "Apr", desc: "Order details are subject to area which you have selected", actionPerformed: [], titleColor: lightBlack, actionItemColor: lightBlack),
Timeline(title: "Tank Reading", timeString: "Mar", desc: "", actionPerformed: ["Order Delivered","Order Loaded"], titleColor: lightBlack, actionItemColor: lightBlack),
Timeline(title: "Order Created", timeString: "Feb", desc: "", actionPerformed: ["Maintenance Req. Raised"], titleColor: darkGreen,actionItemColor: lightBlack),
Timeline(title: "", timeString: "Jan", desc: "", actionPerformed: ["Tank Dips Missed","Credit Note Received","","","","","","Price Book Updated"], titleColor: lightBlack,actionItemColor: darkGreen)
]
作者
许可
TimelineView基于MIT许可。有关更多信息,请参阅LICENSE文件。