Hi all I am working on a calendar using NSCalendar.
I need to find every Sunday and Monday within the month to change the cell color unlike other days ..
Can you help me understand how to find (through the use of NSCalendar) every Sunday and Monday of the current month?
You can get the start end end of the month, enumerate all days in a month (you can use noon), check if the resulting day is less than the end date otherwise stop the enumeration. Then you just need to check if the date's weekday is equal to Sunday or Monday (1 or 2) and add it to the collection:
This will print