| 24-h format | 12-h format | Customize | Example |
|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
pod 'RealTimePicker', '0.0.6'.package(url: "https://github.com/toure20/RealTimePicker", from: "0.0.6")RealTimePickerView was designed over UIPickerView and can be used to pick time (hour, minute) with 24-h and 12-h format. Simply create RealTimePickerView() in the same way you would expect to present UIPickerView and use as a subview.
let view = RealTimePickerView(format: .h24, tintColor: .white)
view.rowHeight = 40.0
view.timeLabelFont = UIFont.systemFont(ofSize: 32, weight: .semibold) // default size is 44
view.colonLabelFont = UIFont.systemFont(ofSize: 32 * 0.75, weight: .bold) // default size
view.formatLabelFont = UIFont.systemFont(ofSize: 20, weight: .semibold) // default size is 24
view.backgroundColor = UIColor.white.withAlphaComponent(0.9)
view.showCurrentTime = true
view.layer.cornerRadius = 24-
updateDateTime(_ date: Date)function set default current time to picker view; -
minuteInterval: Int?initalizer property adjust minute rows data by interval. - Restrict time selection by using maximum and mininum properties
Check out the Sample App for more complex configurations of RealTimePickerView, including how to change hour format, time components and apply layout constaints.
RealTimePicker is released under a MIT License. See LICENSE file for details. Requires iOS 11+ and is compatible with Swift 4+ projects.



