What's New / App Intents & System Integration

What's new in _AppIntents_HealthKit

+1 NewiOS · macOS · watchOS

_AppIntents_HealthKit is a Swift cross-import overlay, not a standalone framework. Its API appears only when a target imports both AppIntents and HealthKit, bridging HealthKit types into App Intents so intents can accept and return HealthKit values.

The 27 SDK adds one new type, AudioContext, with no deprecations or removals. It is the only API change in this overlay for the release.

New

1
extension

AudioContext

NewiOSmacOSwatchOS
extension AudioContext
Declaration
extension AudioContext {

    /// A workout session of any type.
    ///
    /// Use this to donate entities relevant to any workout,
    /// regardless of activity type or intensity.
    ///
    /// You can donate entities to multiple workout contexts simultaneously.
    /// More specific contexts (e.g., a specific activity type) give the system
    /// stronger hints than broader ones (e.g., any workout). The system
    /// considers all matching entities and their relevance when determining
    /// what to suggest.
    public static var workout: AudioContext { get }

    /// A workout session of the given activity type.
    ///
    /// - Parameter activityType: The type of workout in progress.
    public static func workout(activityType: HKWorkoutActivityType) -> AudioContext

    /// A workout session of the given intensity level.
    ///
    /// - Parameter intensityLevel: The intensity of the workout.
    public static func workout(intensityLevel: AudioContext.WorkoutIntensityLevel) -> AudioContext

    /// The intensity level of a workout session.
    ///
    /// Use this type to specify a workout intensity level when donating entities
    /// for workout contexts. You can also initialize it with an `HKWorkoutActivityType`
    /// to donate entities for a specific workout type.
    public struct WorkoutIntensityLevel : Hashable, Sendable {

        public let rawValue: UInt

        public init(rawValue: UInt)

        /// Creates an intensity level from an `HKWorkoutActivityType`.
        public init(_ workoutActivityType: HKWorkoutActivityType)

        /// A low-intensity workout such as yoga, stretching, or walking.
        public static let low: AudioContext.WorkoutIntensityLevel

        /// A medium-intensity workout such as cycling, hiking, or swimming.
        public static let medium: AudioContext.WorkoutIntensityLevel

        /// A high-intensity workout such as running, HIIT, or cross-training.
        public static let high: AudioContext.WorkoutIntensityLevel

        /// Returns a Boolean value indicating whether two values are equal.
        ///
        /// Equality is the inverse of inequality. For any values `a` and `b`,
        /// `a == b` implies that `a != b` is `false`.
        ///
        /// - Parameters:
        ///   - lhs: A value to compare.
        ///   - rhs: Another value to compare.
        public static func == (a: AudioContext.WorkoutIntensityLevel, b: AudioContext.WorkoutIntensityLevel) -> Bool

        /// Hashes the essential components of this value by feeding them into the
        /// given hasher.
        ///
        /// Implement this method to conform to the `Hashable` protocol. The
        /// components used for hashing must be the same as the components compared
        /// in your type's `==` operator implementation. Call `hasher.combine(_:)`
        /// with each of these components.
        ///
        /// - Important: In your implementation of `hash(into:)`,
        ///   don't call `finalize()` on the `hasher` instance provided,
        ///   or replace it with a different instance.
        ///   Doing so may become a compile-time error in the future.
        ///
        /// - Parameter hasher: The hasher to use when combining the components
        ///   of this instance.
        public func hash(into hasher: inout Hasher)

        /// The hash value.
        ///
        /// Hash values are not guaranteed to be equal across different executions of
        /// your program. Do not save hash values to use during a future execution.
        ///
        /// - Important: `hashValue` is deprecated as a `Hashable` requirement. To

Truncated.

No APIs match your filter.

← More in App Intents & System Integration