AnyTransientAppEntity
A type-erased representation of a transient app entity that provides dynamic property access.
Declaration
@dynamicMemberLookup struct AnyTransientAppEntityOverview
Use AnyTransientAppEntity to work with transient entities when you don’t know the specific entity type at compile time.
// Getting transient entity definitions.
let definitions = IntentDefinitions(bundleIdentifier: "com.apple.example")
let sessionEntity = definitions.transientEntities["UserSessionEntity"]
// Creating a transient entity with properties.
var entity = sessionEntity.withProperties(
name: "John Doe",
age: 30
)
// Accessing properties with type safety.
let userName: String? = try entity.name
let userAge: Int? = try entity.age
// Accessing nested properties (requires try).
if try entity.profile.name == "John Doe" {
print("User found")
}