Errors in NSCalendar.h


There are errors in the Apple SDK – NSCalendar.h

The messages in lines 72-103 do not match the corresponding values in lines 48 - 70. When you attempt to use the deprecated NSCalendarUnits an unidentifiable replacement NSCalendarUnit is suggested by the compiler. Once you find the appropriate NSCalendarUnit (in lines 48 - 70) the problem will be solved. It is, however, an inconvenience.

This bug has been reported to Apple.

Here is the fix for Swift 1 - Lesson 8.4

    var timeDateComponents = calendar.components(
        NSCalendarUnit.CalendarUnitHour |           //  HourCalendarUnit deprecated as of IOS 8.0
        NSCalendarUnit.CalendarUnitMinute |         //  MinuteCalendarUnit deprecated as of IOS 8.0
        NSCalendarUnit.CalendarUnitSecond           //  SecondCalendarUnit deprecated as of IOS 8.0
        , fromDate: NSDate())