UIDatePicker interval is 10 minutes?

I am trying to set up the collector for a time interval of 10 minutes to: 8: 00.8: 10.8: 20, etc. With the value of the minute interval:

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 this time:

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

Now, if you are trying to set the time interval, you cannot find a property for this.

What is wrong with that?

+5
source share
1 answer

I assume that you are referring to the minuteInterval property , which is available in iOS2 and later. See Apple documentation below.

The interval at which the data collector should show minutes. You can use this property to set the interval displayed in minutes> wheel (e.g. 15 minutes). The interval value should be evenly divided by 60; if it is not, the default value is used. The default and minimum values ​​are 1; the maximum value is 30.

+14
source

Source: https://habr.com/ru/post/1232514/


All Articles