Android App Development
iOS App Development
Flutter App Development
Cross Platform App Development
Hire on-demand project developers and turn your idea into working reality.
Big thanks to Webkul and his team for helping get Opencart 3.0.3.7 release ready!
Deniel Kerr
Founder. Opencart
Top Partners
Some times we need to pick date or time in application for this we have to create the separate UIView and add UIDatePicker then perform functionality on it. swift provide default feature in UITextField where we need to add view as UIDatepicker so when we tap on it , this will show the respective data whatever you have set on UIDatepicker mode.
There is Various mode of UIDatePicker
a: date picker , time picker, date & Time picker.
For doing this , you have to follow this steps.
1: take a UITextfield in UIViewcontroller and create their outlet like
@IBOutlet weak var sampleDateTextField: UITextField!
2: Now Create the outlet as ActionMode and set editing method as didbeginedit ( this will work when you just tap on UItextfield)
like as
@IBAction func specialDateTextFieldClick(_ sender: UITextField) {}
3: Now define the method
4: Here I have set action , it will call this static method ”
”
Here “ProductAttributeField” is class and name of method is “datePickerFromValueChanged“
Note: you can set date picker mode according to your requirement.
5: Now it time to define their method like that.
Here I have set formatter ,it is required to display the date or you can set different formatter .
6: Now you tap on UITextField then datepicker will show and on changing then automatic fill the date on UItextField.
Your email address will not be published. Required fields are marked*
Name*
Email*
Save my name email and website in this browser for the next time I comment.
We use cookies to personalize your experience. By continuing to visit this website you agree to our use of cookies. Learn more about privacy policy
Great Product, Great Team, and Great Support Service. And if you want to add more features to the product, they can submit any idea that comes to your mind. They really care about their clients and we are really happy and honored to deal with Webkul.
Osama
USA
India
Global
Name
Email
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.