Contextual clues the system uses to show relevant widgets in the Smart Stack on watchOS.
> Note: Smart Stacks are available in iOS, iPadOS, and watchOS. However, functionality provided by RelevanceKit API is only available
in watchOS. Calling its API on other platforms doesn't have any effect.
For more information about widgets in Smart Stacks, refer to <doc://com.apple.documentation/documentation/widgetkit/Widget-Suggestions-In-Smart-Stacks>.
Members (10)
static · iOS 17.0+ · Deprecated in iOS 26.0
date
TypeScript
static dateFromTo(from: globalThis.Date, to: globalThis.Date): RelevantContext
Swift declaration
static func date(from: Date, to: Date) -> RelevantContext
Tells the system a widget is relevant between two dates.
> Note: Smart Stacks are available in iOS, iPadOS, and watchOS. However, functionality provided by RelevanceKit API is only available
in watchOS. Calling its API on other platforms doesn't have any effect.
For more information, refer to <doc://com.apple.documentation/documentation/widgetkit/Widget-Suggestions-In-Smart-Stacks>.
- Parameters:
- from: The moment the widget becomes most relevant to a person.
- to: The moment the widget is no longer relevant to a person.
- Returns: A contextual clue that the system uses to determine the relevance of a widget in the Smart Stack on Apple Watch.
Tells the system a widget is relevant for a known date range and provides an additional contextual hint.
> Note: Smart Stacks are available in iOS, iPadOS, and watchOS. However, functionality provided by RelevanceKit API is only available
in watchOS. Calling its API on other platforms doesn't have any effect.
For more information, refer to <doc://com.apple.documentation/documentation/widgetkit/Widget-Suggestions-In-Smart-Stacks>.
- Parameter range: The exact time and duration a widget is most relevant.
- Parameter kind: An additional contextual hint that helps the system determine the widget's relevance.
- Returns: A contextual clue that the system uses to determine the relevance of a widget in the Smart Stack on Apple Watch.
Tells the system a widget is relevant for a time interval and provides an additional contextual hint.
> Note: Smart Stacks are available in iOS, iPadOS, and watchOS. However, functionality provided by RelevanceKit API is only available
in watchOS. Calling its API on other platforms doesn't have any effect.
For more information, refer to <doc://com.apple.documentation/documentation/widgetkit/Widget-Suggestions-In-Smart-Stacks>.
- Parameter interval: The exact time and duration a widget is most relevant.
- Parameter kind: An additional contextual hint that helps the system determine the widget's relevance.
- Returns: A contextual clue that the system uses to determine the relevance of a widget in the Smart Stack on Apple Watch.
Tells the system a widget is relevant at a specific date and provides an additional contextual hint.
Several widgets might be relevant to a person at a specific time. To help the system show a widget
when it's most relevant, provide a `DateKind` as an additional contextual hint to help it determine
the widget's relevance. For example, a widget that's related to a person's schedule or requires an action,
pass ``DateKind/scheduled``.
> Note: Smart Stacks are available in iOS, iPadOS, and watchOS. However, functionality provided by RelevanceKit API is only available
in watchOS. Calling its API on other platforms doesn't have any effect.
For more information, refer to <doc://com.apple.documentation/documentation/widgetkit/Widget-Suggestions-In-Smart-Stacks>.
- Parameters:
- exact: The moment the widget becomes most relevant to a person.
- kind: An additional contextual hint that helps the system determine the widget's relevance.
- Returns: A contextual clue that the system uses to determine the relevance of a widget in the Smart Stack on Apple Watch.
Tells the system a widget is relevant at a specific date.
Let the system know that a widget is most relevant to a person on a specific date.
For example, an app people use to follow sport events might provide the start of a match or a live broadcast. If you know when
the widget isn't relevant anymore, use ``date(interval:kind:)``.
> Note: Smart Stacks are available in iOS, iPadOS, and watchOS. However, functionality provided by RelevanceKit API is only available
in watchOS. Calling its API on other platforms doesn't have any effect.
For more information, refer to <doc://com.apple.documentation/documentation/widgetkit/Widget-Suggestions-In-Smart-Stacks>.
- Parameter exact: The time the widget is most relevant to a person.
- Returns: A contextual clue that the system uses to determine the relevance of a widget in the Smart Stack on Apple Watch.
Tells the system a widget is relevant because of a person's sleep schedule.
To indicate relevance based on a sleep condition, request the
<doc://com.apple.documentation/documentation/healthkit/hkcategorytypeidentifiersleepanalysis> 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 <doc://com.apple.documentation/documentation/healthkit/authorizing-access-to-health-data>.
> Note: Smart Stacks are available in iOS, iPadOS, and watchOS. However, functionality provided by RelevanceKit API is only available
in watchOS. Calling its API on other platforms doesn't have any effect.
For more information, refer to <doc://com.apple.documentation/documentation/widgetkit/Widget-Suggestions-In-Smart-Stacks>.
- Parameter condition: A value that describes a person's typical bedtime or wakeup time.
- Returns: A contextual clue that the system uses to determine the relevance of a widget in the Smart Stack on Apple Watch.
Tells the system a widget is relevant because of a person's fitness activity.
To indicate relevance based on a fitness condition, request permission to access HealthKit data:
* The ``FitnessCondition/workoutActive`` condition requires usage of <doc://com.apple.documentation/documentation/healthkit/HKWorkoutType>
* The ``FitnessCondition/activityRingsIncomplete`` condition requires usage of
<doc://com.apple.documentation/documentation/healthkit/HKQuantityTypeIdentifierAppleExerciseTime>,
<doc://com.apple.documentation/documentation/healthkit/HKQuantityTypeIdentifierAppleMoveTime>, and
<doc://com.apple.documentation/documentation/healthkit/HKQuantityTypeIdentifierAppleStandTime>.
If contextual fitness information isn't available to the system, fitness clues to signal relevance don't have an effect.
For more information about requesting HealthKit permissions, refer to
<doc://com.apple.documentation/documentation/healthkit/authorizing-access-to-health-data>.
> Note: Smart Stacks are available in iOS, iPadOS, and watchOS. However, functionality provided by RelevanceKit API is only available
in watchOS. Calling its API on other platforms doesn't have any effect.
For more information, refer to <doc://com.apple.documentation/documentation/widgetkit/Widget-Suggestions-In-Smart-Stacks>.
- Parameter condition: A value that describes whether a person is working out or has incomplete activity rings.
- Returns: A contextual clue the system uses to determine the relevance of a widget in the Smart Stack on Apple Watch.
Tells the system a widget is relevant when a person's headphones are connected.
Setting a ``HeadphonesCondition`` to signal relevance to the system doesn't give you access to fitness activity and information.
If contextual fitness information isn't available to the system, fitness clues to signal relevance don't have an effect.
> Note: Smart Stacks are available in iOS, iPadOS, and watchOS. However, functionality provided by RelevanceKit API is only available
in watchOS. Calling its API on other platforms doesn't have any effect.
For more information, refer to <doc://com.apple.documentation/documentation/widgetkit/Widget-Suggestions-In-Smart-Stacks>.
- Parameter headphones: A value that indicates connected headphones.
- Returns: A contextual clue that the system uses to determine the relevance of a widget in the Smart Stack on Apple Watch.
Tells the system a widget is relevant at a person's inferred location.
To indicate relevance at an inferred location, request a person's permission to access their location with the When in Use or Always
access level. For more information on creating a widget that can access location information, refer to
<doc://com.apple.documentation/documentation/widgetkit/accessing-location-information-in-widgets>.
> Note: Smart Stacks are available in iOS, iPadOS, and watchOS. However, functionality provided by RelevanceKit API is only available
in watchOS. Calling its API on other platforms doesn't have any effect.
For more information, refer to <doc://com.apple.documentation/documentation/widgetkit/Widget-Suggestions-In-Smart-Stacks>.
- Parameter inferred: Location information that the system infers from a person's behavior. For example, the system could infer
that a person is at work or at school.
- Returns: A contextual clue that the system uses to determine the relevance of a widget in the Smart Stack on Apple Watch.
Tells the system a widget is relevant at a specific location.
To indicate relevance at a specific location, request a person's permission to access their location with the When in Use or Always
access level. For more information on creating a widget that can access location information, refer to
<doc://com.apple.documentation/documentation/widgetkit/accessing-location-information-in-widgets>.
> Note: Smart Stacks are available in iOS, iPadOS, and watchOS. However, functionality provided by RelevanceKit API is only available
in watchOS. Calling its API on other platforms doesn't have any effect.
For more information, refer to <doc://com.apple.documentation/documentation/widgetkit/Widget-Suggestions-In-Smart-Stacks>.
- Parameter exact: A person's location; for example, their favorite coffee shop.
- Returns: A contextual clue that the system uses to determine the relevance of a widget in the Smart Stack on Apple Watch.