UIDatePicker, setting maximum and minimum dates based on todays date

前端 未结 7 1393
粉色の甜心
粉色の甜心 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).

    0 讨论(0)
提交回复
热议问题