What's New / App Intents & System Integration

What's new in AppIntentsTypeSupport

+35 NewiOS · macOS · tvOS · watchOS

AppIntentsTypeSupport defines the type machinery behind App Intents: how Swift values are identified, wrapped, and converted to and from intent values. It covers entity identifiers and the protocols that map Swift types onto intent values.

The 27 SDK adds 35 APIs with no deprecations or removals. New identifier structs are AppEntityIdentifier, AttributedEntityIdentifier, and AttributedTypeIdentifier, plus IntentValueContainer and IntentValueExpression. The conversion layer adds the protocols IntentValueConvertible, IntentValueConvertibleWrapper, and IntentValueExpressing, with IntentValueConvertible conformances on Array, Set, Optional, and AttributedString.

New

35
struct

AppEntityIdentifier

NewiOSmacOStvOSwatchOS
public struct AppEntityIdentifier : Equatable, Sendable
Declaration
public struct AppEntityIdentifier : Equatable, Sendable {

    /// The type identifier that defines what kind of entity this is.
    ///
    /// This identifier includes information about the entity's type and any
    /// relevant attributes associated with it, uniquely identifying the
    /// entity type within the application's bundle.
    public let entityType: AttributedTypeIdentifier

    /// The string that uniquely identifies this specific entity instance.
    ///
    /// This identifier distinguishes between different instances of the same
    /// entity type. It must be unique within the scope of its entity type.
    public let instanceIdentifier: String

    /// Creates an attributed entity identifier with the specified type and instance identifiers.
    ///
    /// - Parameters:
    ///   - entityType: The type identifier for this entity.
    ///   - instanceIdentifier: The string that uniquely identifies this specific instance.
    public init(entityType: AttributedTypeIdentifier, instanceIdentifier: String)

    /// 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: AppEntityIdentifier, b: AppEntityIdentifier) -> Bool
}
extension

Array

NewiOSmacOStvOSwatchOS
extension Array : IntentValueConvertible where Element : IntentValueConvertible
Declaration
extension Array : IntentValueConvertible where Element : IntentValueConvertible {

    /// Creates a container that represents this array of intent values.
    ///
    /// This method converts each element in the array to its container representation
    /// and wraps them in an `ArrayContainerElement`.
    ///
    /// - Parameter context: The context to use for the conversion.
    /// - Returns: An intent value container representing this array.
    public func makeContainer(context: IntentValueContainer.ConversionContext) -> IntentValueContainer
}
extension

Array

NewiOSmacOStvOSwatchOS
extension Array : IntentValueExpressing where Element : IntentValueConvertible
Declaration
extension Array : IntentValueExpressing where Element : IntentValueConvertible {

    /// Creates a pending expression of an array of intent values.
    ///
    /// The system evaluates the expression when needed,
    /// allowing for lazy conversion of the array's elements.
    ///
    /// - Returns: An intent value expression representing this array.
    public func makeExpression() -> IntentValueExpression
}
struct

AttributedEntityIdentifier

NewiOSmacOStvOSwatchOS
public struct AttributedEntityIdentifier : Equatable, Sendable

A unique identifier for an app entity instance within an application.

AttributedEntityIdentifier combines type and instance information to create a complete identifier that can uniquely identify any app entity instance. This identifier consists of two parts:

1. An entity type identifier that distinguishes different kinds of entities 2. An instance identifier that distinguishes individual instances of the same type

This structure enables the AppIntents framework to reference and retrieve specific entity instances across the system.

Declaration
public struct AttributedEntityIdentifier : Equatable, Sendable {

    /// The type identifier that defines what kind of entity this is.
    ///
    /// This identifier includes information about the entity's type and any
    /// relevant attributes associated with it, uniquely identifying the
    /// entity type within the application's bundle.
    public let entityType: AttributedTypeIdentifier

    /// The string that uniquely identifies this specific entity instance.
    ///
    /// This identifier distinguishes between different instances of the same
    /// entity type. It must be unique within the scope of its entity type.
    public let instanceIdentifier: String

    /// Creates an attributed entity identifier with the specified type and instance identifiers.
    ///
    /// - Parameters:
    ///   - entityType: The type identifier for this entity.
    ///   - instanceIdentifier: The string that uniquely identifies this specific instance.
    public init(entityType: AttributedTypeIdentifier, instanceIdentifier: String)

    /// 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: AttributedEntityIdentifier, b: AttributedEntityIdentifier) -> Bool
}
extension

AttributedString

NewiOSmacOStvOSwatchOS
extension AttributedString : IntentValueConvertible
Declaration
extension AttributedString : IntentValueConvertible {

    /// Creates a container that represents the attributed string.
    ///
    /// This method converts the `AttributedString` to an `NSAttributedString` and wraps it
    /// in an intent value container.
    ///
    /// - Parameter context: The context to use for the conversion.
    /// - Returns: An intent value container representing this attributed string.
    public func makeContainer(context: IntentValueContainer.ConversionContext) -> IntentValueContainer
}
struct

AttributedTypeIdentifier

NewiOSmacOStvOSwatchOS
public struct AttributedTypeIdentifier : Equatable, Sendable

A unique identifier for an app entity or transient app entity type within an application bundle.

Use AttributedTypeIdentifier to uniquely identify entity types across your application. This identifier combines a persistent identifier — typically the entity's type name — with an optional bundle identifier to ensure uniqueness across different bundles.

The system uses these identifiers to track and reference entity types throughout the AppIntents framework, particularly when working with entity specifications, containers, and identifiers.

Declaration
public struct AttributedTypeIdentifier : Equatable, Sendable {

    /// The bundle identifier that contains this entity type.
    ///
    /// When non-nil, this value identifies the application bundle that defines the entity type.
    /// This helps distinguish between entity types with the same name across different applications.
    public let bundleIdentifier: String?

    /// The persistent identifier for this entity type.
    ///
    /// This identifier typically corresponds to the struct name of the original entity declaration
    /// (for example, `LandmarkEntity`). The system uses this value to uniquely identify the entity
    /// type within its bundle.
    public let persistentIdentifier: String

    /// Creates a new attributed type identifier.
    ///
    /// - Parameters:
    ///   - persistentIdentifier: The persistent identifier for the entity type, typically the struct name.
    ///   - bundleIdentifier: The optional bundle identifier that contains this entity type.
    public init(persistentIdentifier: String, bundleIdentifier: String? = nil)

    /// 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: AttributedTypeIdentifier, b: AttributedTypeIdentifier) -> Bool
}
extension

Bool

NewiOSmacOStvOSwatchOS
extension Bool : IntentValueConvertible
Declaration
extension Bool : IntentValueConvertible {
}
extension

CLPlacemark

NewiOSmacOStvOSwatchOS
extension CLPlacemark : IntentValueConvertible
Declaration
extension CLPlacemark : IntentValueConvertible {
}
extension

Date

NewiOSmacOStvOSwatchOS
extension Date : IntentValueConvertible
Declaration
extension Date : IntentValueConvertible {
}
extension

DateComponents

NewiOSmacOStvOSwatchOS
extension DateComponents : IntentValueConvertible
Declaration
extension DateComponents : IntentValueConvertible {
}
extension

DateInterval

NewiOSmacOStvOSwatchOS
extension DateInterval : IntentValueConvertible
Declaration
extension DateInterval : IntentValueConvertible {
}
extension

Double

NewiOSmacOStvOSwatchOS
extension Double : IntentValueConvertible
Declaration
extension Double : IntentValueConvertible {
}
extension

Duration

NewiOSmacOStvOSwatchOS
extension Duration : IntentValueConvertible
Declaration
extension Duration : IntentValueConvertible {
}
extension

Int

NewiOSmacOStvOSwatchOS
extension Int : IntentValueConvertible
Declaration
extension Int : IntentValueConvertible {
}
extension

Int16

NewiOSmacOStvOSwatchOS
extension Int16 : IntentValueConvertible
Declaration
extension Int16 : IntentValueConvertible {
}
extension

Int32

NewiOSmacOStvOSwatchOS
extension Int32 : IntentValueConvertible
Declaration
extension Int32 : IntentValueConvertible {
}
extension

Int64

NewiOSmacOStvOSwatchOS
extension Int64 : IntentValueConvertible
Declaration
extension Int64 : IntentValueConvertible {
}
extension

Int8

NewiOSmacOStvOSwatchOS
extension Int8 : IntentValueConvertible
Declaration
extension Int8 : IntentValueConvertible {
}
struct

IntentValueContainer

NewiOSmacOStvOSwatchOS
public struct IntentValueContainer : Sendable, Equatable

A container that stores a value that supports intent value conversion.

The IntentValueContainer structure provides a type-erased wrapper around values that the App Intents framework can use. It encapsulates the actual value as a container element and provides mechanisms for type-safe access and conversion.

This container serves as an intermediate representation when converting between different types.

Declaration
public struct IntentValueContainer : Sendable, Equatable {

    /// A context that provides additional information for value conversion.
    ///
    /// The `ConversionContext` encapsulates contextual information that might be needed
    /// during the conversion process. Use it to customize how the system converts values to and from containers.
    public struct ConversionContext : Sendable, Hashable {

        /// 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: IntentValueContainer.ConversionContext, b: IntentValueContainer.ConversionContext) -> 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
        ///   conform to `Hashable`, implement the `hash(into:)` requirement instead.
        ///   The compiler provides an implementation for `hashValue` for you.
        public var hashValue: Int { get }
    }

    /// Returns a Boolean value indicating whether two containers are equal.
    ///
    /// Two containers are considered equal if their elements are equal,
    /// as determined by the `equals(other:)` method of the container elements.
    ///
    /// - Parameters:
    ///   - lhs: A container to compare.
    ///   - rhs: Another container to compare.
    /// - Returns: `true` if the containers are equal; otherwise, `false`.
    public static func == (lhs: IntentValueContainer, rhs: IntentValueContainer) -> Bool
}
extension

IntentValueContainer

NewiOSmacOStvOSwatchOS
extension IntentValueContainer : IntentValueExpressing
Declaration
extension IntentValueContainer : IntentValueExpressing {

    /// Creates an intent value expression that represents this container.
    ///
    /// This method creates an expression that wraps this container directly,
    /// allowing for lazy evaluation during the conversion process.
    ///
    /// - Returns: An intent value expression representing this container.
    public func makeExpression() -> IntentValueExpression
}
protocol

IntentValueConvertible

NewiOSmacOStvOSwatchOS
public protocol IntentValueConvertible : IntentValueExpressing

A protocol that allows the system to use types to as app intent parameters or properties.

A type that conforms to IntentValueConvertible enables the App Intents framework to convert it to and from intent value containers. This protocol forms the foundation of the App Intents type conversion system, enabling seamless data exchange between your app and the AppIntents framework.

To make a custom type usable in AppIntents, conform it to this protocol by implementing the required makeContainer(context:) method.

Declaration
public protocol IntentValueConvertible : IntentValueExpressing {

    /// Creates an intent value container that represents this value.
    ///
    /// This method converts the value to a type-erased container that App Intents can use.
    /// The container encapsulates the value and provides
    /// mechanisms for type-safe access and conversion.
    ///
    /// - Parameter context: The context to use for the conversion.
    /// - Returns: An intent value container representing this value.
    func makeContainer(context: IntentValueContainer.ConversionContext) -> IntentValueContainer
}
extension

IntentValueConvertible

NewiOSmacOStvOSwatchOS
extension IntentValueConvertible
Declaration
extension IntentValueConvertible {

    /// Creates an intent value expression that represents this value.
    ///
    /// This implementation creates an expression that wraps this value directly,
    /// allowing for lazy evaluation during the conversion process.
    ///
    /// - Returns: An intent value expression representing this value.
    public func makeExpression() -> IntentValueExpression
}
protocol

IntentValueConvertibleWrapper

NewiOSmacOStvOSwatchOS
public protocol IntentValueConvertibleWrapper : IntentValueConvertible

A protocol for types that wrap another intent value that supports conversion.

IntentValueConvertibleWrapper enables you to create specialized types that derive their IntentValueConvertible conformance from an underlying base type. This pattern allows you to extend existing convertible types with additional functionality while preserving their ability to work within the AppIntents framework.

Use this protocol when you want to create a type that:

  • Wraps an existing IntentValueConvertible type
  • Adds domain-specific properties or methods
  • Maintains compatibility with the AppIntents framework

## Example

struct LandmarkEntity: IntentValueConvertibleWrapper {
    var baseValue: AnyAppEntity

    init(baseValue: AnyAppEntity) {
        self.baseValue = baseValue
    }

    var continent: String {
        get throws {
            try baseValue.continent
        }
    }
}
Declaration
public protocol IntentValueConvertibleWrapper : IntentValueConvertible {

    /// The underlying type that provides protocol conformance.
    associatedtype BaseValue : IntentValueConvertible

    /// Creates a new instance that wraps the specified base value.
    ///
    /// - Parameter baseValue: The underlying value to wrap.
    /// - Throws: An error if the wrapper cannot be initialized with the given base value.
    init(baseValue: Self.BaseValue) throws

    /// The underlying value that this type wraps.
    var baseValue: Self.BaseValue { get }
}
extension

IntentValueConvertibleWrapper

NewiOSmacOStvOSwatchOS
extension IntentValueConvertibleWrapper
Declaration
extension IntentValueConvertibleWrapper {

    /// Creates an intent value container that represents this wrapper.
    ///
    /// This implementation delegates to the base value's container creation method,
    /// ensuring that the wrapper behaves consistently with its underlying type.
    ///
    /// - Parameter context: The context to use for the conversion.
    /// - Returns: An intent value container representing this wrapper.
    public func makeContainer(context: IntentValueContainer.ConversionContext) -> IntentValueContainer
}
protocol

IntentValueExpressing

NewiOSmacOStvOSwatchOS
public protocol IntentValueExpressing : Sendable

A protocol for types that can create intent value expressions.

IntentValueExpressing enables types to participate in the lazy evaluation system of the App Intents framework. Types conforming to this protocol can create expressions that are evaluated only when needed, improving performance by deferring potentially expensive conversions.

This protocol forms the foundation of the lazy evaluation mechanism in the intent value conversion system.

Declaration
public protocol IntentValueExpressing : Sendable {

    /// Creates an intent value expression that represents this value.
    ///
    /// This method creates an expression that the system can evaluate later to produce
    /// an intent value container.
    ///
    /// - Returns: An intent value expression representing this value.
    func makeExpression() -> IntentValueExpression
}
struct

IntentValueExpression

NewiOSmacOStvOSwatchOS
public struct IntentValueExpression : Sendable

A type that represents a lazily evaluated intent value.

IntentValueExpression provides a mechanism for lazy evaluation of intent values, allowing values to be converted to containers only when needed. This approach improves performance by deferring potentially expensive conversions until they're actually required.

Declaration
public struct IntentValueExpression : Sendable {
}
extension

Measurement

NewiOSmacOStvOSwatchOS
extension Measurement : IntentValueConvertible
Declaration
extension Measurement : IntentValueConvertible {
}
extension

Never

NewiOSmacOStvOSwatchOS
extension Never : IntentValueConvertible
Declaration
extension Never : IntentValueConvertible {
}
extension

Optional

NewiOSmacOStvOSwatchOS
extension Optional : IntentValueConvertible where Wrapped : IntentValueConvertible
Declaration
extension Optional : IntentValueConvertible where Wrapped : IntentValueConvertible {

    /// Creates a container that represents this optional intent value.
    ///
    /// If the optional is `nil`, it creates a container that resolves to a null vlaue. If the optional isn't `nil`,
    /// it delegates the conversation to the wrapped value's container creation.
    ///
    /// - Parameter context: The context to use for the conversion.
    ///
    /// - Returns: An intent value container representing this optional value.
    public func makeContainer(context: IntentValueContainer.ConversionContext) -> IntentValueContainer
}
extension

Optional

NewiOSmacOStvOSwatchOS
extension Optional : IntentValueExpressing where Wrapped : IntentValueExpressing
Declaration
extension Optional : IntentValueExpressing where Wrapped : IntentValueExpressing {

    /// Creates an expression that represents this optional intent value.
    ///
    /// This method handles both the `.some` and `.none` cases:
    /// - For `.none`, it creates a pending expression that will resolve to a null value
    /// - For `.some`, it delegates to the wrapped value's expression creation
    ///
    /// - Returns: An intent value expression representing this optional value.
    public func makeExpression() -> IntentValueExpression
}
extension

PersonNameComponents

NewiOSmacOStvOSwatchOS
extension PersonNameComponents : IntentValueConvertible
Declaration
extension PersonNameComponents : IntentValueConvertible {
}
extension

Set

NewiOSmacOStvOSwatchOS
extension Set : IntentValueConvertible where Element : IntentValueConvertible
Declaration
extension Set : IntentValueConvertible where Element : IntentValueConvertible {

    /// Creates a container that represents this set of intent values.
    ///
    /// This method converts each element in the set to its container representation
    /// and wraps them in an `ArrayContainerElement`.
    ///
    /// - Parameter context: The context to use for the conversion.
    /// - Returns: An intent value container representing this set.
    public func makeContainer(context: IntentValueContainer.ConversionContext) -> IntentValueContainer
}
extension

Set

NewiOSmacOStvOSwatchOS
extension Set : IntentValueExpressing where Element : IntentValueConvertible
Declaration
extension Set : IntentValueExpressing where Element : IntentValueConvertible {

    /// Creates a pending expression of a set of intent values.
    ///
    /// The system evaluates the expression when needed,
    /// allowing for lazy conversion of the set's elements.
    ///
    /// - Returns: An intent value expression representing this set.
    public func makeExpression() -> IntentValueExpression
}
extension

String

NewiOSmacOStvOSwatchOS
extension String : IntentValueConvertible
Declaration
extension String : IntentValueConvertible {
}
extension

URL

NewiOSmacOStvOSwatchOS
extension URL : IntentValueConvertible
Declaration
extension URL : IntentValueConvertible {
}

No APIs match your filter.

← More in App Intents & System Integration