<!--
{
  "availability" : [
    "iOS: 9.3.0 -",
    "iPadOS: 9.3.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.3 -",
    "tvOS: 9.2.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.3.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVPlayerItemMetadataCollectorPushDelegate/metadataCollector(_:didCollect:indexesOfNewGroups:indexesOfModifiedGroups:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(pl)AVPlayerItemMetadataCollectorPushDelegate(im)metadataCollector:didCollectDateRangeMetadataGroups:indexesOfNewGroups:indexesOfModifiedGroups:"
  },
  "title" : "metadataCollector(_:didCollect:indexesOfNewGroups:indexesOfModifiedGroups:)"
}
-->

# metadataCollector(_:didCollect:indexesOfNewGroups:indexesOfModifiedGroups:)

Tells the delegate the collected metadata group information has changed and needs to be updated.

```
func metadataCollector(_ metadataCollector: AVPlayerItemMetadataCollector, didCollect metadataGroups: sending [AVDateRangeMetadataGroup], indexesOfNewGroups: IndexSet, indexesOfModifiedGroups: IndexSet)
```

## Parameters

`metadataCollector`

The [`AVPlayerItemMetadataCollector`](/documentation/AVFoundation/AVPlayerItemMetadataCollector) on which this delegate is set.

`metadataGroups`

The complete array of all metadata groups meeting the criteria of the output.

`indexesOfNewGroups`

The indexes of the `metadataGroups` added since the last delegate invocation of this method.

`indexesOfModifiedGroups`

The indexes of the `metadataGroups` modified since the last delegate invocation of this method.

## Discussion

This method is called when additions or modifications are made to the array of collected metadata groups. The initial invocation will have `indexesOfNewGroup` referring to every index in `metadataGroups`. Subsequent invocations may not contain all previously collected metadata groups if they no longer refer to a region in the player item’s [`seekableTimeRanges`](/documentation/AVFoundation/AVPlayerItem/seekableTimeRanges).

---

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)