sleep(_:)
Tells the system a widget is relevant because of a person’s sleep schedule.
Declaration
static func sleep(_ condition: RelevantContext.SleepCondition) -> RelevantContextParameters
- condition:
A value that describes a person’s typical bedtime or wakeup time.
Return Value
A contextual clue that the system uses to determine the relevance of a widget in the Smart Stack on Apple Watch.
Discussion
To indicate relevance based on a sleep condition, request the sleepAnalysis permission. If contextual sleep information isn’t available to the system, sleep clues to signal relevance don’t have an effect. For more information about requesting HealthKit permissions, refer to Authorizing access to health data.