MKDatePicker
Requirements:
- iOS 9.0+
- Xcode 10.0+
- Swift 5.0+
Demo Figure
Installation Cocoapods
pod 'MKDatePicker', '~> 1.0.0'
Use
let contentView = PickerViewController()
contentView.type = type
contentView.headerView.title = NSAttributedString(string: headerTitle, attributes: [NSAttributedString.Key.font : UIFont.boldSystemFont(ofSize: 16),
NSAttributedString.Key.foregroundColor: UIColor.black])
contentView.selectDate = selectDate
contentView.maximumDate = maximumDate
contentView.minimumDate = minimumDate
contentView.selectedAttributes = selectedAttributes
contentView.confirmCallBack = { (_, result) in
debugPrint(result.toString(format: dateFormatType))
}
contentView.cancelCallBack = { _ in
debugPrint("取消")
}
contentView.show()
License
MKDatePicker is available under the MIT license. See the LICENSE file for more info.