Disable Past Date in UIDatePicker in IPhone Objective C

user658442 picture user658442 · Mar 14, 2011 · Viewed 24.5k times · Source

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 from the DatePicker.

To do this i want to disable past date & time in DatePicker only instead of putting a compare validation in the code.

Is this possible or there is an option to disable the past date in the DatePicker control itself.

Answer

visakh7 picture visakh7 · Mar 14, 2011

Did you try this

[picker setMinimumDate: [NSDate date]];