<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NotificationQueue",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSNotificationQueue"
  },
  "title" : "NotificationQueue"
}
-->

# NotificationQueue

A notification center buffer.

```
class NotificationQueue
```

## Overview

Whereas a notification center distributes notifications when posted, notifications placed into the queue can be delayed until the end of the current pass through the run loop or until the run loop is idle. Duplicate notifications can be coalesced so that only one notification is sent although multiple notifications are posted.

A notification queue maintains notifications in first in, first out (FIFO) order. When a notification moves to the front of the queue, the queue posts it to the notification center, which in turn dispatches the notification to all objects registered as observers.

Every thread has a default notification queue, which is associated with the default notification center for the process. You can create your own notification queues and have multiple queues per center and thread.

## Topics

### Creating Notification Queues

[`init(notificationCenter:)`](/documentation/Foundation/NotificationQueue/init(notificationCenter:))

Initializes and returns a notification queue for the specified notification center.

### Getting the Default Queue

[`default`](/documentation/Foundation/NotificationQueue/default)

Returns the default notification queue for the current thread.

### Managing Notifications

[`enqueue(_:postingStyle:coalesceMask:forModes:)`](/documentation/Foundation/NotificationQueue/enqueue(_:postingStyle:coalesceMask:forModes:))

Adds a notification to the notification queue with a specified posting style, criteria for coalescing, and run loop mode.

[`enqueue(_:postingStyle:)`](/documentation/Foundation/NotificationQueue/enqueue(_:postingStyle:))

Adds a notification to the notification queue with a specified posting style.

[`dequeueNotifications(matching:coalesceMask:)`](/documentation/Foundation/NotificationQueue/dequeueNotifications(matching:coalesceMask:))

Removes all notifications from the queue that match a provided notification using provided matching criteria.

### Constants

[`NotificationQueue.NotificationCoalescing`](/documentation/Foundation/NotificationQueue/NotificationCoalescing)

The constants that specify how notifications are coalesced.

[`NotificationQueue.PostingStyle`](/documentation/Foundation/NotificationQueue/PostingStyle)

The constants that specify when notifications are posted.



---

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)