Adding a day to current date in iOS

前端 未结 6 1667
孤城傲影
孤城傲影 2021-01-02 11:03

I saw this post: iOS and finding Tomorrow.

The code provided is:

units = NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit;
NSDateComponen         


        
6条回答
  •  鱼传尺愫
    2021-01-02 11:46

    For swift googlers:

    NSCalendar.currentCalendar().dateByAddingUnit(NSCalendarUnit.CalendarUnitDay, value: 1, toDate: date, options: nil)!
    

提交回复
热议问题