Get the first day of week without WeekCalendarUnit
I would like to get the first day of the week depending on a NSDate. It works fine but I have a warning because WeekCalendarUnit is deprecated. I made some research and I tried to replace WeekCalendarUnit with : static var CalendarUnitWeekday: NSCalendarUnit { get } static var CalendarUnitWeekdayOrdinal: NSCalendarUnit { get } static var CalendarUnitWeekOfMonth: NSCalendarUnit { get } static var CalendarUnitWeekOfYear: NSCalendarUnit { get } But I don't have the same result. Here is my junk of code : var date = NSDate() dateFormatter.dateFormat = "dd/YY" let calendar = NSCalendar