Type Alias

dispatch_group_t

A group of block objects submitted to a queue for asynchronous invocation.

Declaration

typedef NSObject<OS_dispatch_group> *dispatch_group_t;

Discussion

A dispatch group is a mechanism for monitoring a set of blocks. Your application can monitor the blocks in the group synchronously or asynchronously depending on your needs. By extension, a group can be useful for synchronizing for code that depends on the completion of other tasks.

Note that the blocks in a group may be run on different queues, and each individual block can add more blocks to the group.

The dispatch group keeps track of how many blocks are outstanding, and GCD retains the group until all its associated blocks complete execution.

See Also

Creating a Dispatch Group

dispatch_group_create

Creates a new group to which you can assign block objects.