In our day-to-day life, dates are pretty straight forward - we read them all the time, make plans around them, and share them with other people. Apart from the occasional missed birthday party all of these date-based tasks go surprisingly smoothly. Which is remarkable when you stop to think how complex our date systems are. It works this smoothly because everyone is making some pretty large, unspoken assumptions around the dates that they see - what calendar is used, what timezone is used, the ordering of d…
#date & time
3 posts with this tag
Ask any iOS developer about DateFormatter and one of the first things you will hear is that creating a DateFormatter instance is an expensive operation. The second thing you will hear is that after creating one you need to cache it. In this post, I want to look at how expensive it is to create DateFormatter instances and how we can cache them effectively. To determine just how expensive they are we will need to conduct a small experiment 🔬. If you'd prefer not to have to manually build up the below exam…
This took me an age to track down. How do you get the value out of the UIDatePicker that the user has selected. Having used UIPickerView a lot, I thought that UIDatePicker object would have been an extension of UIPickerView and with the same methods, however this turned out not to be the case and the solution for UIDatePicker was much more straight forward. [datePicker date]; //where datePicker is the name of your date picker instance…