You can use it with storyboard and Programmatically
Easy to customize and interact
- iOS 11.0+
- Xcode 9+
CollapsibleDatePicker is available through Swift Package Manager. To install
it, simply go to Xcode under File > Swift Packages > Add Package Dependency...
If you prefer not to use SPM, you can integrate CollapsibleDatePicker into your project manually.
You can use CollapsibleDatePicker from storyboard easily By changing the type of a regular UIView into CollapsibleDatePickerView and set its Moudle to be CollapsibleDatePicker.
let collapseView = CollapsibleDatePickerView()
collapseView.dateType = .dateAndTime
collapseView.doneButtonBackgroundColor = #colorLiteral(red: 0, green: 0.4784313725, blue: 1, alpha: 1)
// get the selected date like this:
collapseView.selectedDate = {(date) in
print(date)
}
// CollapsibleDatePickerView by default is invisible so you can show it like this(considering you have already set an action for a button):
@IBAction func showCollapsibleDatePickerView(_ sender: UIButton) {
collapseView.show()
}
Mohammed Reza Ghate
- https://github.com/mohammed1955
- https://www.linkedin.com/in/mohamadrezaghate/
- mohammed.r.ghate@gmail.com
CollapsibleDatePicker is available under the MIT license. See the LICENSE file for more info.