Swift - Check if date is in next week / month. ( isDateInNextWeek() isDateInNextMonth() )
问题 We have those convenient functions in calendar: let calendar = NSCalendar.currentCalendar() calendar.isDateInToday(date) calendar.isDateInTomorrow(date) But I am missing those two: calendar.isDateInNextWeek(date) calendar.isDateInNextMonth(date) As @Rob mentioned, the meaning is: "in the calendar week starting this coming Sunday, going through the following Saturday" I having a hard time figuring out how to implement those functions in a robust way that covers all the corner cases. Can