---
title: DispatchGroup
framework: dispatch
role: symbol
role_heading: Class
path: dispatch/dispatchgroup
---

# DispatchGroup

A group of tasks that you monitor as a single unit.

## Declaration

```swift
class DispatchGroup
```

## Overview

Overview Groups allow you to aggregate a set of tasks and synchronize behaviors on the group. You attach multiple work items to a group and schedule them for asynchronous execution on the same queue or different queues. When all work items finish executing, the group executes its completion handler. You can also wait synchronously for all tasks in the group to finish executing.

## Topics

### Creating a Dispatch Group

- [init()](dispatch/dispatchgroup/init().md)

### Adding a Completion Handler

- [notify(qos:flags:queue:execute:)](dispatch/dispatchgroup/notify(qos:flags:queue:execute:).md)
- [notify(queue:work:)](dispatch/dispatchgroup/notify(queue:work:).md)

### Waiting for Tasks to Finish Executing

- [wait()](dispatch/dispatchgroup/wait().md)
- [wait(timeout:)](dispatch/dispatchgroup/wait(timeout:).md)
- [wait(wallTimeout:)](dispatch/dispatchgroup/wait(walltimeout:).md)

### Updating the Group Manually

- [enter()](dispatch/dispatchgroup/enter().md)
- [leave()](dispatch/dispatchgroup/leave().md)

## Relationships

### Inherits From

- [DispatchObject](dispatch/dispatchobject.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Queues and Tasks

- [DispatchQueue](dispatch/dispatchqueue.md)
- [DispatchWorkItem](dispatch/dispatchworkitem.md)
- [Dispatch Queue](dispatch/dispatch-queue.md)
- [Dispatch Work Item](dispatch/dispatch-work-item.md)
- [Dispatch Group](dispatch/dispatch-group.md)
- [Workloop](dispatch/workloop.md)
