I have a UIDatePicker that only takes times in 30min intervals. On viewDidLoad I want to get the current time to the nearest half hour. How would I go about doing this?
I have a UIDatePicker that only takes times in 30min intervals. On viewDidLoad I
Share
Use
NSDateComponentsto get and manipulate the hour and minute of a date. Here’s how I did it:Hope this helps!