iOS 14 || UIDatePicker

MdNiks
2 min readJul 12, 2020

--

Welcome Guys,

Always Apple comes up with new things, Everybody knows apple was introduced new things in UIDatePicker, it’s one of the best things introduced in this year’s WWDC as everyone widely uses it.

We are following traditional methodology for UIDatePicker, Now make a change to do….👇👇👇👇👇

Note: For this tutorial, you will need Xcode 12, at the time of writing this article, Xcode 12 is available as a beta version for download.

Let’s do it.

Just 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 for showing UIDatePicker in screen looks like above images.

Next, Run the application in your simulator or your device.

Amazing right !!!!

Hold on Guys !!!, many times while developing applications, 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.

Let’s do it.

And it’s look like that 👇

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.

Just use it. w00t! How cool is that and all done with just follow fews steps.

If you have any comments or questions, please respond below! I’d love to hear from you.

--

--

MdNiks

I'm an accomplished iOS programmer with more than 12 years of experience working in a collaborative environment with tight deadlines.