I know that I can figure out today’s date by [NSDate date]; but how would I find out today day of the week, like Saturday, Friday etc.
I know that %w can be used in NSDateFormatter, but I don’t know to use it.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
See @HuguesBR‘s answer if you just need the weekday without other components (requires iOS 8+).
(If you don’t get a correct answer, check if you have mistyped
NSCalendarUnitWeekdaywith other week-related components likeNSCalendarUnitWeekdayOrdinal, etc.)Swift 3: