Skip to content

a simple time picker created based on UIPickerView

Notifications You must be signed in to change notification settings

datle021194/TimePicker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

TimePicker

a simple time picker created based on UIPickerView

Alt text

Usage Example

let timePickerVC = DLTimePickerVC()
addChild(timePickerVC)

timePickerVC.view.frame = timePickerContainerView.bounds
timePickerContainerView.addSubview(timePickerVC.view)

timePickerVC.didMove(toParent: self)

Custom timepicker value

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)

Get timepicker value

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?) {

}

About

a simple time picker created based on UIPickerView

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages