CocoaPods (What is that?)
- Add
pod 'PopupDatePicker'
to yourPodfile
; - Then run
pod update
in Terminal; - Re-open your project using
.xcworkspace
, putimport PopupDatePicker
in the swift files you plan; - Rebuild and enjoy.
Firstly, import PopupDatePicker
.
import PopupDatePicker
let datePicker = PopupDatePicker.init(currentDate: nil, minLimitDate: Date(), maxLimitDate: nil, dpShowType: "yyyy-MM-dd", wildcardArray: nil, wildcardDefaults: nil) {_,_ in }
datePicker.show()
/// PopupDatePicker
///
/// - Parameters:
/// - currentDate: Current Date
/// - minLimitDate: min limit Date
/// - maxLimitDate: max limit Date
/// - dpShowType:
/*
- yyyy: year 1970
- MM: month 01
- dd: day 01
- HH: hours 0..23
- mm: minutes 0..59
- ss: seconds 0..59
- $: splitter of components for the picker view. yyyy$MM$dd
- -: splitter of Year month day. yyyy-MM-dd
- :: splitter of hour minute second. HH:mm:dd
- ?{key}?: wildcard, something like ?hourange? the hourange is key, if use this flag you need set wildcard array
*/
/// - wildcardArray: if use DPShowType ?? flag you need set this param. Set DPShowType like ?key?$?key1? then set wildcardArray ["key":[ "a", "b" ], "key1":[ "c", "d" ]]
/// - wildcardDefaults: wildcardDefaults ["key": "value"]
/// - callback: (Date, [String:String]) -> (), first param is selected Date, second params is wildcard selected data
Feel free to send pull requests or propose changes.
Email: [email protected]
PopupDatePicker is released under an MIT license. See the LICENSE file.