---
title: NSMetadataQuery.DidStartGatheringMessage
framework: foundation
role: symbol
role_heading: Structure
path: foundation/nsmetadataquery/didstartgatheringmessage
---

# NSMetadataQuery.DidStartGatheringMessage

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

## Declaration

```swift
struct DidStartGatheringMessage
```

## Overview

Overview Observe this message with the identifier didStartGathering, or specify its type directly to the addObserver(of:for:using:) method. The Subject of this message type is NSMetadataQuery. This message interoperates with the notification NSMetadataQueryDidStartGathering. The system notifies observers of the message when the NotificationCenter posts the notification. Similarly, the system notifies observers of the notification when it posts the message.

## Topics

### Creating a message

- [init()](foundation/nsmetadataquery/didstartgatheringmessage/init().md)

## Relationships

### Conforms To

- [NotificationCenter.AsyncMessage](foundation/notificationcenter/asyncmessage.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Working with notification messages

- [NSMetadataQuery.DidFinishGatheringMessage](foundation/nsmetadataquery/didfinishgatheringmessage.md)
