I am trying to set a repeatingInterval of a UILocalNotification using these values but, as always, Apple docs are vague as hell.
Any clues?
thanks.
Maybe look at this blog I just found about the subject?
AFAIK, NSCalendarUnits
are primarely used to split a date or timeInterval into date components (NSDateComponents
), to extract the weekday of a date, the year of the date, the hour component of a time, and so on.
In this context:
NSWeekCalendarUnit
of a date correspond to the week index in the year (from 1st to 52nd week - or 53rd for years with 53 weeks)NSWeekdayCalendarUnit
corresponds to the day in the week (from Mon to Sun)NSDayCalendarUnit
corresponds to the day in the year (from 1 to 365)When using the NSCalendarUnit type with repeatingInterval
, the UILocalNotification will be triggered when the corresponding unit changes:
NSWeekCalendarUnit
will trigger the notification every week (every 7 days)NSWeekdayCalendarUnit
will trigger the notification "every weekday", which corresponds to the same thing here as NSDayCalendarUnit
which corresponds to "every day" in the context of a repeatingInterval.