测试已测试 | ✗ |
语言语言 | SwiftSwift |
许可 | MIT |
发布最后发布 | 2017年12月 |
SwiftSwift 版本 | 3.0 |
SPM支持 SPM | ✗ |
由 piggybear 维护。
使用 FSCalendar 封装
pod 'PGActionSheetCalendar'
let calendar = PGActionSheetCalendar()
present(calendar, animated: false, completion: nil)
有两种监听选中日期的方法
1、代理
calendar.delegate = self
func calendar(_ calendar: PGActionSheetCalendar, didSelectDate components: DateComponents) {
print("year = ", components.year!,"month = ", components.month!, "day = ", components.day!)
}
2、闭包
calendar.didSelectDateComponents = {components in
print("year = ", components.year!,"month = ", components.month!, "day = ", components.day!)
}
设置标题
let label = calendar.titleLabel
label.text = "PGCalendar"
设置按钮样式
calendar.cancelButton.setTitleColor(UIColor.red, for: .normal)
calendar.sureButton.setTitleColor(UIColor.red, for: .normal)
设置日历样式