Contents

EntityIdentifier

A type that uniquely identifies a specific instance of an app entity.

Declaration

struct EntityIdentifier

Overview

The value used should be unique across all entities of the given type. Entities which are relevant across executions of the application should have stable identifiers that persist across executions.

Entities, by default, conform to the Identifiable protocol. Use a type for the id that conforms to EntityIdentifierConvertible. Default implementations for String, UUID and Int are provided.

For example:

struct Song: AppEntity {
    let id = UUID()
}

Topics

Creating an entity identifier

Getting the identifier details

Type Aliases

Type Properties

See Also

Entity identity