TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Dec 2014 |
Maintained by Ernesto García.
Objective-C class to calculate Sunrise, Sunset, and Twilight times based on the user's current location and time zone.
EDSunriseSet is an Objective-C wrapper for the C languages routines created by Paul Schlyter. Calculation is done entirely by the C-code routines. EDSunrisetSet bridges those calculations to common cocoa classes like NSDate and NSTimeZone.
To get information about the sunrise, sunset, and twilight use the method below.
+(EDSunriseSet *)sunrisesetWithTimezone:(NSTimeZone *)timezone latitude:(double)lat longitude:(double)longt
This method returns an EDSunriseSet
object which can be used to access the following NSDateComponents
each containing a date, hour, minute, and second:
localSunrise
localSunset
localCivilTwilightStart
and localCivilTwilightEnd
localNauticalCivilTwilightStart
and localNauticalCivilTwilightEnd
localAstronomicalTwilightStart
and localAstronomicalTwilightEnd
You may also access NSDate
proprties on EDSunriseSet
which give a read-only value of the date for the specified property. These properties include sunrise
and sunset
among others.
EDSunriseSet license is MIT based. Attribution is appreciated, but not required.