Calendar Picker written in Swift
CalendarPicker
CalendarPicker written in Swift 5.0. Compatible with iOS 8.0+
Installation
CalendarPicker is available through CocoaPods. To install
it, simply add the following line to your Podfile:
pod 'CalendarPicker'
Usage
import CalendarPicker
let calendarPicker = CalendarPicker()
Property
Locale
calendarPicker.localeType = .en
calendarPicker.localeType = .ko
calendarPicker.localeType = .jp
calendarPicker.localeType = .zh
calendarPicker.localeType = .default
Date
calendarPicker.date = Date()
print(calendarPicker.selectedDateComponent)
minimum & maximum
calendarPicker.minimumDate = Date()
calendarPicker.maximumDate = Date()
Show Week
calendarPicker.isShowWeek = true
Colors
calendarPicker.textColor = .black
calendarPicker.saturdayColor = .blue
calendarPicker.sundayColor = .red
Font
calendarPicker.font = UIFont.systemFont(ofSize: 23)
Function
calendarPicker.update(animated: true)
calendarPicker.setDate(Date(), animated: true)
Delegate
class ViewController: UIViewController{
override func viewDidLoad() {
super.viewDidLoad()
let calendarPicker = CalendarPicker()
calendarPicker.delegate = self
}
}
// MARK: CalendarPickerDelegate
extension ViewController: CalendarPickerDelegate {
func calendarPickerSelectDate(_ dateCompontnt: DateComponent) {
}
}
Author
pikachu987, pikachu77769@gmail.com