NSCalendarUnit.Type doesnt have a member named CalendarUnitWeekDay

785 views Asked by At
let currentDayOfWeek = NSCalendar.currentCalendar().component(.CalendarUnitWeekday, fromDate: NSDate())

In this place I get an error:

NSCalendarUnit.Type doesnt have a member named CalendarUnitWeekDay

1

There are 1 answers

0
zrzka On

It doesn't, it does have Weekday, which can be used in this way:

let calendar = NSCalendar.currentCalendar()
let component = calendar.component(.Weekday, fromDate:NSDate())