Objective C - get the following day from today (tomorrow)

后端 未结 3 1551
青春惊慌失措
青春惊慌失措 2020-11-29 06:51

How can I check to see if a date is inherently TOMORROW?

I don\'t want to add hours or anything to a date like today, because if today is already 22:59,

3条回答
  •  悲&欢浪女
    2020-11-29 07:06

    You might be able to leverage NSCalendar/Calendar to create tomorrow:

    extension Calendar {
        var tomorrow: Date? {
            return date(byAdding: .day, value: 1, to: startOfDay(for: Date()))
        }
    }
    

提交回复
热议问题