enqueue(_:postingStyle:coalesceMask:forModes:)
Adds a notification to the notification queue with a specified posting style, criteria for coalescing, and run loop mode.
Declaration
func enqueue(_ notification: Notification, postingStyle: NotificationQueue.PostingStyle, coalesceMask: NotificationQueue.NotificationCoalescing, forModes modes: [RunLoop.Mode]?)Parameters
- notification:
The notification to add to the queue.
- postingStyle:
The posting style for the notification. The posting style indicates when the notification queue should post the notification to its notification center.
- coalesceMask:
A mask indicating what criteria to use when matching attributes of
notificationto attributes of notifications in the queue. The mask is created by combining any of the constants None, Onname, and Onsender. - modes:
The list of modes the notification may be posted in. The notification queue will only post the notification to its notification center if the run loop is in one of the modes provided in the array.
This parameter may be
nil, in which case it defaults to Default.