---
title: AnyAppEnum
framework: appintentstesting
role: symbol
role_heading: Structure
path: appintentstesting/anyappenum
---

# AnyAppEnum

A type-erased representation of an app enumeration that provides dynamic enumeration value access.

## Declaration

```swift
struct AnyAppEnum
```

## Overview

Overview Use AnyAppEnum to work with enumerations when you don’t know the specific enumeration type at compile time. At compile, the AnyAppEnum structure resolves to your app enum type and gives you access to its value as shown in the following example: let definitions = IntentDefinitions(     bundleIdentifier: "com.apple.example" ) let colorEnum = definitions.enums["Color"] let priorityEnum = definitions.enums["Priority"]

// Creating enumeration cases. let redCase = colorEnum.makeCase("red") let highPriority = priorityEnum.makeCase("high")

// Accessing enumeration properties. let rawValue = redCase.rawValue  // "red"

// Converting raw values in a type-safe way. let colorName = try redCase.as(String.self) let priorityLevel = try highPriority.as(String.self)

## Topics

### Creating an enum

- [init(typeIdentifier:rawValue:)](appintentstesting/anyappenum/init(typeidentifier:rawvalue:).md)
- [init(typeIdentifier:value:)](appintentstesting/anyappenum/init(typeidentifier:value:).md)
- [typeIdentifier](appintentstesting/anyappenum/typeidentifier.md)
- [rawValue](appintentstesting/anyappenum/rawvalue.md)

### Converting enum values

- [as(_:)](appintentstesting/anyappenum/as(_:).md)

### Default Implementations

- [CustomStringConvertible Implementations](appintentstesting/anyappenum/customstringconvertible-implementations.md)

## Relationships

### Conforms To

- [Copyable](swift/copyable.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Escapable](swift/escapable.md)
- [IntentValueConvertible](appintents/intentvalueconvertible.md)
- [IntentValueExpressing](appintents/intentvalueexpressing.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Intermediate types

- [AnyAppIntent](appintentstesting/anyappintent.md)
- [AnyAppEntity](appintentstesting/anyappentity.md)
- [AnyEntityQuery](appintentstesting/anyentityquery.md)
- [AnyTransientAppEntity](appintentstesting/anytransientappentity.md)
