---
title: NSMetadataQuery.DidFinishGatheringMessage
framework: foundation
role: symbol
role_heading: Structure
path: foundation/nsmetadataquery/didfinishgatheringmessage
---

# NSMetadataQuery.DidFinishGatheringMessage

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

## Declaration

```swift
struct DidFinishGatheringMessage
```

## Overview

Overview Observe this message with the identifier didFinishGathering, 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 NSMetadataQueryDidFinishGathering. 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/didfinishgatheringmessage/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.DidStartGatheringMessage](foundation/nsmetadataquery/didstartgatheringmessage.md)
