RealTimePicker Save

Time picker view written in Swift

Project README

RealTimePicker

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

24-h format 12-h format Customize Example

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

Installation

pod 'RealTimePicker', '0.0.6'
.package(url: "https://github.com/toure20/RealTimePicker", from: "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

Last Updates

  • 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

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.

Open Source Agenda is not affiliated with "RealTimePicker" Project. README Source: toure20/RealTimePicker
Stars
29
Open Issues
1
Last Commit
7 months ago
License
MIT

Open Source Agenda Badge

Open Source Agenda Rating