Soufiane ROCHDI
Soufiane ROCHDI

Reputation: 1663

LocalNotification repeatingInterval value for weekly notification

I already check a lot of Questions here in Stackoverflow and also checked the apple documentation. So, please no need to declare this question as duplicated.

I am using swift and trying to create a local notification that repeats every Friday. The problem that I don't know which value to use, with the repeatInterval attribute, and what is the difference between all of these (link):

And as usual, the apple documentation is not easy to understand, at least for me :(

Upvotes: 1

Views: 151

Answers (1)

Josh Hamet
Josh Hamet

Reputation: 957

Weekday is a number from 1 to 7 where Sunday is represented by 1 and the other days so forth until Saturday which is represented by 7. This is the one you're looking for

WeekOfMonth is exactly how it sounds. 2 would be the second week of each month, 3 would be the third week of each month, etc.

WeekOfYear is similar and interpreted according to the calendar. So 3rd week is 3rd week of the year, etc.

WeekdayOrdinal is probably the one that's most confusing. Here's the definition according to Apple Documentation.

Weekday ordinal units represent the position of the weekday within the next larger calendar unit, such as the month. For example, 2 is the weekday ordinal unit for the second Friday of the month.

Upvotes: 1

Related Questions