Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIDatePicker interval of 10 minutes?

I am trying to set a picker for times with 10 minutes intervals so : 8:00,8:10,8:20 , etc , with the minute interval property :

UIDatePicker *timePick = [[UIDatePicker alloc]initWithFrame:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height/1.5)];
timePick.datePickerMode =UIDatePickerModeTime;

[timePick addTarget:self action:@selector(dateIsChanged:) forControlEvents:UIControlEventValueChanged];
timePick.minuteInterval=10;

What happens is that the times are like this :

13:00
14:10
15:20
16:30

Now if trying to set the hours interval , cant find a property for this .

Whats wrong with it ?

like image 398
Curnelious Avatar asked Sep 29 '15 08:09

Curnelious


1 Answers

I guess you are referring to the minuteInterval property which is available from iOS2 and later. See below Apple's documentation.

The interval at which the date picker should display minutes. You can use this property to set the interval displayed by the minutes >wheel (for example, 15 minutes). The interval value must be evenly divided >into 60; if it is not, the default value is used. The default and minimum values are 1; the maximum value is 30.

like image 148
Bogdan Avatar answered Oct 07 '22 19:10

Bogdan