The date used for previews on watchOS, primarily for complications
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static NSDate *watchPreviewDate() { | |
static NSDateComponents *comps; | |
static dispatch_once_t onceToken; | |
dispatch_once(&onceToken, ^{ | |
comps = [NSDateComponents new]; | |
comps.calendar = NSCalendar.autoupdatingCurrentCalendar; | |
comps.timeZone = NSTimeZone.localTimeZone; | |
comps.year = 2014; | |
comps.month = 9; | |
comps.day = 9; | |
comps.hour = 10; | |
comps.minute = 9; | |
comps.second = 30; | |
}); | |
return comps.date; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment