Created
September 19, 2019 05:10
-
-
Save leptos-null/21837fe407d8d2620698b1530e56abd8 to your computer and use it in GitHub Desktop.
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