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
In iOS 14, Apple introduced a new property of UIDatePicker which is datePickerStyle, because of this UIDatePicker creating issue with UITextField inputView. From iOS 14 and above you need to set the datePickerStyle in order to make it work.
Note: For this tutorial, you will need Xcode 12, at the time of writing this article.
Create new project in Xcode and open Main.storyboard and add UIDatePicker in ViewController then assign it IBOutlet.
Now open ViewController.Swift file and attach below code.
Run the application in your simulator or your device.
Now, we don’t need the date picker to be on screen the whole time, we may want to click on a button and pick the date from the picker like before.
That’s it. Now, if you run the application. Your app should function like the one shown below.
It automatically updates the date so you don’t need to look into the handling of the date object. This is significant relief from those bottom sheets and custom pop-ups.
If you have any comments or questions, please respond below!
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.
Be the first to 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
Webkul is a truly trusted and supported IT Company to develop business ideas for e-commerce. They provide professional support after deploying the solution to production and be responsible to act for fixing the reported issues or system errors. We highly encourage to deal with Webkul for business development.
Hussein Zawia
Co-founder, 24Dokan
USA
India
Global
Name
Email
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.