UIDatePicker, setting maximum and minimum dates based on todays date

前端 未结 7 1416
粉色の甜心
粉色の甜心 2020-12-02 18:36

If I have a UIDatePicker, and I wish to set the minimum and maximum date range to be between thirty years ago and thirty years in the future, how would I set that up?

7条回答
  •  旧巷少年郎
    2020-12-02 19:15

    m_datePicker.maximumDate = [NSDate date];
    

    You can use this line of code to set max date (Today).

提交回复
热议问题