Disable Past Date in UIDatePicker in IPhone Objective C

前端 未结 3 453
春和景丽
春和景丽 2021-02-05 00:29

I am new to Objective C and IPhone development.

I am using a UIDatePicker in my IPhone Application and my requirement is to allow the user to choose the future date only

3条回答
  •  北恋
    北恋 (楼主)
    2021-02-05 00:38

    Use the following line,to disable the previous dates of an UIDatePicker.

    [picker setMinimumDate: [NSDate date]];
    

    The current date is displayed as shown below

    enter image description here

提交回复
热议问题