开发者

how to validate date in date picker in iphone?

开发者 https://www.devze.com 2022-12-22 18:59 出处:网络
i am working on a project where i am getting 开发者_如何学运维date value from date-picker view. I want to check for the date so that it should not enter the date prior to today\'s date...

i am working on a project where i am getting 开发者_如何学运维date value from date-picker view. I want to check for the date so that it should not enter the date prior to today's date... plz help me with that... thank you..


In Objective-C

Set the date picker's minimumDate property:

datePicker.minimumDate = [NSDate date];

In Swift 4.x,

datePicker.minimumDate = Date() 

(Where datePicker is a reference to your UIDatePicker )

0

精彩评论

暂无评论...
验证码 换一张
取 消