---
title: leave()
framework: dispatch
role: symbol
role_heading: Instance Method
path: dispatch/dispatchgroup/leave()
---

# leave()

Explicitly indicates that a block in the group finished executing.

## Declaration

```swift
func leave()
```

## Discussion

Discussion Calling this function decrements the current count of outstanding tasks in the group. Using this function (with enter()) allows your application to properly manage the task reference count if it explicitly adds and removes tasks from the group by a means other than using the dispatch_group_async function. A call to this function must balance a call to enter(). It is invalid to call it more times than enter(), which would result in a negative count.

## See Also

### Updating the Group Manually

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