How to accept only Month and Year using DatePicker in iOS
I am building an app using swift and in that app there is one field for accepting expiry date for Debit card for payment purpose. How can I accept only month and year by using DatePicker in Swift.
If it is not possible using datepicker then please suggest any another way.
Thank you in advance.
- Save datePicker value using NSUserdefaults(xcode,swift2)
- iPhone:DatePicker dd/mm/yyyy
- IOS Date Picker Like A Popup Keyboard Functionality?
- How to change date picker date to a NSDate type but with zero seconds
- User set time for notification in swift
- Swift: using UIDatePicker as UITextField inputView not updating
2 Solutions Collect From Internet About “How to accept only Month and Year using DatePicker in iOS”
yourDatepicker.datePickerMode = UIDatePickerModeDate;
yourDatepicker.datePickerMode = UIDatePickerMode.Date
yourDatepicker.datePickerMode = .date
the another modes are
the above method not working well, then check this link
Not really an answer but an alternative: why not use a picker for month an a picker for year like most apps do (also on websites the equivalent a popupmenu is used)
- iOS 8 UITableView separator inset 0 not working
- Remove white Space after hide views in scrollview?
- Xcode: Memory Usage Comparison
- Customizing the buttons on a UIAlertView
- How to change all UIButton fonts to custom font?
- MPMoviePlayerController Add custom Play button
- How to retrieve Facebook friendlist and save it to parse?
- what is the difference between target and project?
- NSJSONSerialization and Emoji
- Implementing long running tasks in background IOS
- Osx Lion: Xcode 4.1 how do I setup a c++0x project
- Convert decimal coordinate into degrees, minutes, seconds, direction
- How do I create an array of tuples?
- How to remove common items from two struct arrays in Swift
- Meaning of symbol ^ in Objective C