Schedules a notification block to be submitted to a queue when the execution of a specified dispatch block has completed.


void dispatch_block_notify(dispatch_block_t block, dispatch_queue_t queue, dispatch_block_t notification_block);



The dispatch block to observe.

The result of passing NULL or a block object not returned by the dispatch_block_create or dispatch_block_create_with_qos_class function is undefined.


The queue to which the supplied notification block is submitted when the observed block completes.


The notification block to submit when the observed block object completes.


This function submits the notification block immediately if execution of the observed block object has already completed.

It is not possible to be notified of multiple executions of the same block object with this interface. Instead, use the dispatch_group_notify function for that purpose.

A single dispatch block may either be observed one or more times and executed once, or it may be executed any number of times. The behavior of any other combination is undefined. Submission to a dispatch queue counts as an execution, even if cancellation using the dispatch_block_cancel function means the block's code never runs.

If multiple notification blocks are scheduled for a single block object, there is no defined order in which the notification blocks are submitted to their associated queues.