<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppIntents",
  "identifier" : "/documentation/AppIntents/AppEnum",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "App Intents"
    ],
    "preciseIdentifier" : "s:10AppIntents0A4EnumP"
  },
  "title" : "AppEnum"
}
-->

# AppEnum

An interface to express that a custom type has a predefined, static set of values.

```
protocol AppEnum : AppValue, StaticDisplayRepresentable, RawRepresentable where Self.RawValue : LosslessStringConvertible
```

## Overview

When you want an app intent parameter or app entity property to have a fixed set of values, set the type of the
underlying property to one that adopts the `AppEnum` protocol. In custom code, you use enumerations to limit
the number of values available to a property of that type. For example, a fitness app might specify the available
workout types using an enumeration instead of a string, because the enumeration requires someone to choose
only known values. The `AppEnum` protocol adds metadata that Siri and other system features require to interact
with your enumeration or custom type.

Add the `AppEnum` protocol to an existing enumeration or type you plan to use in an app intent or app entity. For
best results, base your enumeration on a type that’s easily convertible to a string such as the
<doc://com.apple.documentation/documentation/Swift/String> or <doc://com.apple.documentation/documentation/Swift/Int> type.

The `AppEnum` protocol adds conformance to several other protocols to your type, including the
[`TypeDisplayRepresentable`](/documentation/AppIntents/TypeDisplayRepresentable) and [`CaseDisplayRepresentable`](/documentation/AppIntents/CaseDisplayRepresentable) protocols. You’re responsible for
implementing these protocols and providing descriptions of your type and each of the cases it contains. The following
example shows an enumeration that a workout app uses to specify the available activities. The implementations of the
[`typeDisplayRepresentation`](/documentation/AppIntents/TypeDisplayRepresentable/typeDisplayRepresentation) and [`caseDisplayRepresentations`](/documentation/AppIntents/CaseDisplayRepresentable/caseDisplayRepresentations)
properties provide the protocol-mandated descriptions of the type and each activity. The system uses your descriptions
in dialogs and to resolve parameters more quickly.

```swift
enum ActivityStyle: String, AppEnum {
    case biking
    case equestrian
    case hiking
    case jogging
    case crossCountrySkiing
    case snowshoeing

    // Describe the overall type.
    static var typeDisplayRepresentation: TypeDisplayRepresentation {
        TypeDisplayRepresentation(
            name: LocalizedStringResource("Activity style", table: "AppIntents"),
            numericFormat: LocalizedStringResource("\(placeholder: .int) data", table: "AppIntents"))
    }

    // Describe the individual cases.
    static var caseDisplayRepresentations: [Self: DisplayRepresentation] = [
        .biking: DisplayRepresentation(title: "Biking", subtitle: "Mountain bike ride"),
        .equestrian: DisplayRepresentation(title: "Equestrian", subtitle: "Equestrian sports"),
        .hiking: DisplayRepresentation(title: "Hiking", subtitle: "A lengthy outdoor walk"),
        .jogging: DisplayRepresentation(title: "Jogging", subtitle: "A gentle run"),
        .crossCountrySkiing: DisplayRepresentation(title: "Skiing", subtitle: "Cross-country skiing"),
        .snowshoeing: DisplayRepresentation(title: "Snowshoeing", subtitle: "Walking in the snow")
    ]
}
```

> Note: Don’t adopt the ``doc://com.apple.AppIntents/documentation/AppIntents/AppEntity`` and `AppEnum` protocols in the same type. An app entity type represents data
> that can change dynamically, whereas an `AppEnum` represents static data that doesn’t change.

## Topics

### Resolving the type

[`defaultResolverSpecification`](/documentation/AppIntents/AppEnum/defaultResolverSpecification)

### URL representation

[`EnumURLRepresentation`](/documentation/AppIntents/EnumURLRepresentation)

The type that provides the URL for an app enum.

## Relationships

### Conforming Types

[`StringSearchScope`](/documentation/AppIntents/StringSearchScope)

[`VideoCategory`](/documentation/AppIntents/VideoCategory)

### Inherits From

[`Sendable`](/documentation/Swift/Sendable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`TypeDisplayRepresentable`](/documentation/AppIntents/TypeDisplayRepresentable)

[`RawRepresentable`](/documentation/Swift/RawRepresentable)

[`CustomLocalizedStringResourceConvertible`](/documentation/Foundation/CustomLocalizedStringResourceConvertible)

[`AppValue`](/documentation/AppIntents/AppValue)

[`Equatable`](/documentation/Swift/Equatable)

[`CaseDisplayRepresentable`](/documentation/AppIntents/CaseDisplayRepresentable)

[`CaseIterable`](/documentation/Swift/CaseIterable)

[`StaticDisplayRepresentable`](/documentation/AppIntents/StaticDisplayRepresentable)

[`PersistentlyIdentifiable`](/documentation/AppIntents/PersistentlyIdentifiable)

[`Hashable`](/documentation/Swift/Hashable)

### Inherited By

[`AssistantSchemaEnum`](/documentation/AppIntents/AssistantSchemaEnum)

[`URLRepresentableEnum`](/documentation/AppIntents/URLRepresentableEnum)

[`AppUnionValueCasesProviding`](/documentation/AppIntents/AppUnionValueCasesProviding)

[`AssistantEnum`](/documentation/AppIntents/AssistantEnum)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)