测试已测试 | ✗ |
语言语言 | SwiftSwift |
许可协议 | MIT |
发布日期上次发布 | 2017年10月 |
SwiftSwift 版本 | 3.0 |
SPM支持 SPM | ✗ |
由 Miraan Tabrez 维护。
要运行示例项目,请克隆仓库,然后首先从 Example 目录运行 pod install
它非常简单
let dateRangePickerViewController = CalendarDateRangePickerViewController(collectionViewLayout: UICollectionViewFlowLayout())
dateRangePickerViewController.delegate = self
let navigationController = UINavigationController(rootViewController: dateRangePickerViewController)
self.navigationController?.present(navigationController, animated: true, completion: nil)
只需实现代理方法
protocol CalendarDateRangePickerViewControllerDelegate {
func didTapCancel()
func didTapDoneWithDateRange(startDate: Date!, endDate: Date!)
}
您还可以设置其他选项来覆盖默认设置
dateRangePickerViewController.minimumDate = Date()
dateRangePickerViewController.maximumDate = Calendar.current.date(byAdding: .year, value: 2, to: Date())
dateRangePickerViewController.selectedStartDate = Date()
dateRangePickerViewController.selectedEndDate = Calendar.current.date(byAdding: .day, value: 10, to: Date())
CalendarDateRangePickerViewController 通过 CocoaPods 提供。要安装,只需将以下行添加到您的 Podfile 中
pod 'CalendarDateRangePickerViewController'
miraan, [email protected]
CalendarDateRangePickerViewController 在 MIT 许可下提供。有关更多信息,请参阅 LICENSE 文件。