Class

DispatchGroup

DispatchGroup allows for aggregate synchronization of work. You can use them to submit multiple different work items and track when they all complete, even though they might run on different queues. This behavior can be helpful when progress can’t be made until all of the specified tasks are complete.

Topics

Initializers

init()

Creates a new group with which block objects can be associated.

Instance Methods

func enter()

Explicitly indicates that a block has entered the group.

func leave()

Explicitly indicates that a block in the group has completed.

func notify(qos: DispatchQoS, flags: DispatchWorkItemFlags, queue: DispatchQueue, execute: () -> Void)

Schedules a block to be submitted to a queue with a specified quality of service class and configuration when a group of previously submitted block objects have completed.

func notify(queue: DispatchQueue, work: DispatchWorkItem)

Schedules a work item to be submitted to a queue when a group of previously submitted block objects have completed.

func wait()

Waits synchronously for the previously submitted work to complete.

func wait(timeout: DispatchTime)

Waits synchronously for the previously submitted work to complete, and returns if the work is not completed before the specified timeout period has elapsed.

func wait(wallTimeout: DispatchWallTime)

Waits synchronously for the previously submitted work to complete, and returns if the work is not completed before the specified timeout period has elapsed.

Relationships

Inherits From