How to accept only Month and Year using DatePicker in iOS
Choice-1
Objective-C
yourDatepicker.datePickerMode = UIDatePickerModeDate;
Swift
yourDatepicker.datePickerMode = UIDatePickerMode.Date
Swift3
yourDatepicker.datePickerMode = .date
the another modes are
- UIDatePickerModeTime,
- UIDatePickerModeDate,
- UIDatePickerModeDateAndTime,
- UIDatePickerModeCountDownTimer
Choice-2
the above method not working well, then check this link