TimelineView
TimelineView是一个展示时间更新的最简单组件。
示例
要运行示例项目,请克隆仓库,然后从Example目录运行 pod install
。
需求
安装
CocoaPods
TimelineView通过CocoaPods提供。要安装它,只需将以下行添加到您的Podfile中
pod 'TimelineView'
用法
添加TimelineView
在您的UIViewController中添加UIView,并将其自定义类指定为TimelineView,
将该视图的出口提供给它,然后按照以下方式将时间线数据提供给该视图:
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文件。