Class

Notification​Queue

NSNotificationQueue objects (or simply notification queues) act as buffers for notification centers (instances of NSNotificationCenter). 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 also be coalesced so that only one notification is sent although multiple notifications are posted. A notification queue maintains notifications (instances of NSNotification) generally in a first in first out (FIFO) order. When a notification rises 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.

Overview

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

Nested Types

Notification​Queue.Posting​Style

These constants specify when notifications are posted.

Notification​Queue.Notification​Coalescing

These constants specify how notifications are coalesced.

Symbols

Creating Notification Queues

init(notification​Center:​ Notification​Center)

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

Getting the Default Queue

class var `default`:​ Notification​Queue

Returns the default notification queue for the current thread.

Managing Notifications

func enqueue(Notification, posting​Style:​ Notification​Queue.Posting​Style)

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

func dequeue​Notifications(matching:​ Notification, coalesce​Mask:​ Int)

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

Constants

Notification​Queue.Notification​Coalescing

These constants specify how notifications are coalesced.

Notification​Queue.Posting​Style

These constants specify when notifications are posted.

Relationships

Inherits From