---
title: "enumerator(for:)"
framework: ContactProvider
role: symbol
role_heading: Instance Method
platforms: [iOS 18.0+, iPadOS 18.0+]
path: "contactprovider/contactitemenumerating/enumerator(for:)"
---

# enumerator(for:)

Provide an enumerator for the contact items collection.

## Declaration

```swift
func enumerator(for collection: ContactItem.Identifier) -> any ContactItemEnumerator
```

## Parameters

- `collection`: The collection to enumerate; defaults to doc://com.apple.ContactProvider/documentation/ContactProvider/ContactItem/Identifier/rootContainer.

## Discussion

Discussion The collection represents all contacts for the domain (ContactItem.Identifier.rootContainer).

## See Also

### Providing an enumeration

- [ContactItem.Identifier](contactprovider/contactitem/identifier.md)
- [ContactItemEnumerator](contactprovider/contactitemenumerator.md)
