I need a UIDatePicker
for selecting Month and Year only. I checked the class reference documents. Looks like UIDatePicker
is a UIView
.
You can use the open source library named
AKMonthYearPickerView
import AKMonthYearPickerView
AKMonthYearPickerView.sharedInstance.show(vc: viewController, doneHandler: doneHandler, completetionalHandler: completetionalHandler)
https://github.com/ali-cs/AKMonthYearPickerView
to install it using pods,
pod 'AKMonthYearPickerView'
to customize previous years limit and bar color
AKMonthYearPickerView.sharedInstance.barTintColor = UIColor.blue
AKMonthYearPickerView.sharedInstance.previousYear = 4