its an registration apps where user selected date from uipickerpicker should be greater than equal to current date and if user enter past date then show alert text "Cant enter past date" in ios.. IF we set Property to UIDatePicker then user is unknown to actual date select it will store current date that main issue with using property...
Instead of that, you can use the minimumDate property of UIDatePicker
. Set the minimumDate to current date, so your date picker don't allow the user to pick a past date.
[yourDatePicker setMinimumDate:[NSDate date]];
If you want to compare the date you can do it like:
NSDate *currentDate = [NSDate date];
if ([pickedDate currentDate] == NSOrderedDescending)
{
// Picked date is lesser than current date
// Show validation result
}