<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -",
    "watchOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSMetadataQuery/DidStartGatheringMessage",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:So15NSMetadataQueryC10FoundationE24DidStartGatheringMessageV"
  },
  "title" : "NSMetadataQuery.DidStartGatheringMessage"
}
-->

# NSMetadataQuery.DidStartGatheringMessage

A message a metadata query sends when it starts the initial result-gathering phase of the query.

```
struct DidStartGatheringMessage
```

## Overview

Observe this message with the identifier [`didStartGathering`](/documentation/Foundation/NotificationCenter/MessageIdentifier/didStartGathering), or specify its type directly to the `addObserver(of:for:using:)` method.
The [`Subject`](/documentation/Foundation/NotificationCenter/MainActorMessage/Subject) of this message type is [`NSMetadataQuery`](/documentation/Foundation/NSMetadataQuery).

This message interoperates with the notification [`NSMetadataQueryDidStartGathering`](/documentation/Foundation/NSNotification/Name-swift.struct/NSMetadataQueryDidStartGathering).
The system notifies observers of the message when the [`NotificationCenter`](/documentation/Foundation/NotificationCenter) posts the notification.
Similarly, the system notifies observers of the notification when it posts the message.

## Topics

### Creating a message

[`init()`](/documentation/Foundation/NSMetadataQuery/DidStartGatheringMessage/init())

Creates a message for a metadata query that is starting its initial result gathering.

## Relationships

### Conforms To

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

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

[`AsyncMessage`](/documentation/Foundation/NotificationCenter/AsyncMessage)

---

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)