a simple time picker created based on UIPickerView
let timePickerVC = DLTimePickerVC()
addChild(timePickerVC)
timePickerVC.view.frame = timePickerContainerView.bounds
timePickerContainerView.addSubview(timePickerVC.view)
timePickerVC.didMove(toParent: self)
Default the timepicker set the current time. You can change timepicker to your value by pass a Date to it:
let tenMinutesInSecond = 600.0
let myDate = Date(timeIntervalSinceNow: tenMinutesInSecond)
timePickerVC.setTimePickerToDate(myDate)
TimePicker return a UTC Date, if the time in picker is equal or smaller than current time then the return value will return the time of next date:
timePickerVC.timePickerValue() // return UTC Date
Get time picker value when it's value changed:
let timePickerVC = DLTimePickerVC()
timePickerVC.delegate = self
...
func timePickerDidChangeValue(_ value: Date?) {
}