One Logo Pool Ball
AppIntents · IOS API REFERENCE

EntityIdentifierConvertible

protocol · iOS 16.0+ · SDK 27.1

protocol EntityIdentifierConvertible

An interface for converting between an entity's identifier and its string representation. Every entity provides a stable, unique identifier that the framework uses as a concrete reference to the entity while mediating between your app and other parts of the system. To enforce this requirement, the ``AppEntity`` protocol inherits the <doc://com.apple.documentation/documentation/swift/identifiable> protocol. Wherever possible, use <doc://com.apple.documentation/documentation/swift/string>, <doc://com.apple.documentation/documentation/swift/int>, or <doc://com.apple.documentation/documentation/foundation/uuid> for an identifier's type. If you must use a different data type, use this protocol to extend that type and implement the required support. For example, an app that integrates with the <doc://com.apple.documentation/documentation/musickit> framework might use <doc://com.apple.documentation/documentation/musickit/musicitemid> as the type for an entity's identifier. ```swift extension MusicItemID: EntityIdentifierConvertible { public var entityIdentifierString: String { rawValue } public init?(entityIdentifierString: String) { self = MusicItemID(entityIdentifierString) } } ``` > Important: Keep your ``entityIdentifierString`` to 4096 characters or fewer. Otherwise, the framework truncates the value, and you might not be able to convert the truncated value back to its originating type.

Members (0)

This type has no directly callable members in this snapshot. See the framework’s skipped declarations for unsupported APIs.

Skipped declarations

No declarations were skipped in this snapshot.

All AppIntents types →