Skip to content
 
 

Repository files navigation

DatePicker

CI Status Version License Platform

Alt Text

Installation

DatePicker is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'DatePicker', '0.1.1'

Quick Usage

  1. Import the library
import UIKit
import DatePicker

class ViewController: UIViewController {
}
  1. Setup
  • Picker between today and 100 years from now:
let datePicker = DatePicker()
datePicker.setup() { (date) in
	//Process Date returned when date changed
	print("\(date)")
}) { (date) in
	// Process Date returned when select button is pressed
	print("\(date)")
}

Alt Text

  • Picker with minimum and maximum dates:
let datePicker = DatePicker()
datePicker.setup(min: minDate, max: maxDate) { (date) in
	//Process Date returned when date changed
	print("\(date)")
}) { (date) in
	// Process Date returned when select button is pressed
	print("\(date)")
}

In the example below we have set minDate and maxDate to be between July 18, 2011 and September 10, 2020 Alt Text

  1. Display
  • Screen Center:
datePicker.display(in: self)
  • Or as Popover:
datePicker.displayPopOver(on: button, in: self)

Alt Text

Credit

License

DatePicker is available under the MIT license. See the LICENSE file for more info.

About

A Date Picker library for iOS

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages