Swiftpack.co - toure20/RealTimePicker as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by toure20.
toure20/RealTimePicker 0.0.6
Time picker view written in Swift
⭐️ 21
🕓 3 weeks ago
iOS
.package(url: "https://github.com/toure20/RealTimePicker.git", from: "0.0.6")

RealTimePicker

RealTimePicker is an elegant and customizable time picker written in Swift.

24-h format 12-h format Custom Example
<img style="max-width:100%;" width=200px src=https://github.com/toure20/RealTimePicker/blob/master/Screenshots/demo_1.gif?raw=true />

Platform: iOS 11.0+ Language: Swift 4+ CocoaPods compatible License: MIT

Installation

pod 'RealTimePicker', '0.0.6'

Usage

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

Use updateDateTime(_ date: Date) function in order to set default time to picker view.

Sample App

Check out the Sample App for more complex configurations of RealTimePickerView, including how to change hour format, time components and apply layout constaints.

License

RealTimePicker is released under a MIT License. See LICENSE file for details. Requires iOS 11+ and is compatible with Swift 4+ projects.

GitHub

link
Stars: 21
Last commit: 3 weeks ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

0.0.6
14 weeks ago
  • showUnitSeparator property added for visibility of ":" indicator
  • fixed bug with current time

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics