UIDatePicker 15 Minute Increments Swift -


in swift, i'm wondering how use uidatepicker select 15 minute increments. instead of having hours 60 minutes, want able select 00 minutes, 15 minutes, 30 minutes, , 45 minutes.

here current implementation

var schedulepicker: uidatepicker = uidatepicker()  schedulepicker.datepickermode = uidatepickermode.dateandtime     schedulepicker.addtarget(self, action: "handleschedulepicker:", forcontrolevents: uicontrolevents.valuechanged)     textfield9.inputview = schedulepicker  .... func handleschedulepicker(sender: uidatepicker) {     var dateformatter = nsdateformatter()     dateformatter.dateformat = "mmm/dd/yy hh:mm a"     textfield9.text = "\(dateformatter.stringfromdate(sender.date))" } 

set shedulepicker.minuteinterval = 15

i found answer here: https://developer.apple.com/library/ios/documentation/uikit/reference/uidatepicker_class/#//apple_ref/occ/instp/uidatepicker/minuteinterval

it's take @ documentation :)


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -