DatePicker 1.0.1

DatePicker 1.0.1

Maintained by Amir Shayegh.



  • By
  • amirshayegh

DatePicker

CI Status Version License Platform

Alt Text

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

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

pod 'DatePicker'

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.