<!--
{
  "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/IntentItemCollection",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "App Intents"
    ],
    "preciseIdentifier" : "s:10AppIntents20IntentItemCollectionV"
  },
  "title" : "IntentItemCollection"
}
-->

# IntentItemCollection

Return this object to provide an advanced list of options, optionally divided in sections.

```
struct IntentItemCollection<Result> where Result : _IntentValue
```

## Example

```
struct CreateBookIntent: AppIntent {
    @Parameter(title: "Author Name", optionsProvider: AuthorNamesOptionsProvider())
    var authorName: String

    struct AuthorNamesOptionsProvider: DynamicOptionsProvider {
        func results() async throws -> ItemCollection<Int> {
            ItemCollection {
                ItemSection("Italian Authors") {
                    "Dante Alighieri"
                    "Alessandro Manzoni"
                }
                ItemSection("Russian Authors") {
                    "Anton Chekhov"
                    "Fyodor Dostoevsky"
                }
            }
        }
    }
}
```

## Topics

### Initializers

[`init(promptLabel: LocalizedStringResource?, usesIndexedCollation: Bool, items: [Result])`](/documentation/AppIntents/IntentItemCollection/init(promptLabel:usesIndexedCollation:items:))

Create a `ItemCollection` containing `Items`, or one or more `Sections`.

[`init(promptLabel: LocalizedStringResource?, usesIndexedCollation: Bool, sections: [IntentItemSection<Result>])`](/documentation/AppIntents/IntentItemCollection/init(promptLabel:usesIndexedCollation:sections:))

Create an `ItemCollection` containing one or more `Sections`.

[`init(promptLabel: LocalizedStringResource?, usesIndexedCollation: Bool, sectionsBuilder: () -> [IntentItemSection<Result>])`](/documentation/AppIntents/IntentItemCollection/init(promptLabel:usesIndexedCollation:sectionsBuilder:))

Create an `ItemCollection` containing `Items`, or one or more `Sections` provided by a builder.

### Instance Properties

[`var items: [Result.ValueType]`](/documentation/AppIntents/IntentItemCollection/items)

Returns all results as an array.

[`var sections: [IntentItemSection<Result>]`](/documentation/AppIntents/IntentItemCollection/sections)

### Type Properties

[`static var empty: IntentItemCollection<Result>`](/documentation/AppIntents/IntentItemCollection/empty)

Returns an empty result.

## Relationships

### Conforms To

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

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

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

---

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)