<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "FileProvider",
  "identifier" : "/documentation/FileProvider/NSFileProviderExtension/enumerator(for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "File Provider",
      "FileProvider"
    ],
    "preciseIdentifier" : "c:objc(cs)NSFileProviderExtension(im)enumeratorForContainerItemIdentifier:error:"
  },
  "title" : "enumerator(for:)"
}
-->

# enumerator(for:)

Returns an enumerator for the specified item.

```
func enumerator(for containerItemIdentifier: NSFileProviderItemIdentifier) throws -> any NSFileProviderEnumerator
```

## Parameters

`containerItemIdentifier`

The persistent identifier for a document or folder.

## Return Value

An enumerator for the specified document or folder, or `nil` in Objective-C if an error has occurred.

## Discussion

Your File Provider extension must define one or more classes that adopt the [`NSFileProviderEnumerator`](/documentation/FileProvider/NSFileProviderEnumerator) protocol. Instances of these classes must be able to enumerate both the contents of the specified item and any changes to the content.

Override this method to return an instance of your custom [`NSFileProviderEnumerator`](/documentation/FileProvider/NSFileProviderEnumerator) class for the specified item (either a document or a folder). For more information, see [Content and Change Tracking](/documentation/FileProvider/content-and-change-tracking).

---

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)