IntentItemCollection
Return this object to provide an advanced list of options, optionally divided in sections.
Declaration
struct IntentItemCollection<Result> where Result : _IntentValueExample
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:usesIndexedCollation:items:)init(promptLabel:usesIndexedCollation:sections:)init(promptLabel:usesIndexedCollation:sectionsBuilder:)