开发者

how to validate date in date picker in iphone?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜