---
title: suspend()
framework: dispatch
role: symbol
role_heading: Instance Method
path: dispatch/dispatchobject/suspend()
---

# suspend()

Suspends the invocation of block objects on a dispatch object.

## Declaration

```swift
func suspend()
```

## Discussion

Discussion By suspending a dispatch object, your application can temporarily prevent the execution of any blocks associated with that object. The suspension occurs after completion of any blocks running at the time of the call. Calling this function increments the suspension count of the object, and calling resume() decrements it. While the count is greater than zero, the object remains suspended, so you must balance each suspend() call with a matching resume() call. Any blocks submitted to a dispatch queue or events observed by a dispatch source are delivered once the object is resumed. important: It is a programmer error to release an object that is currently suspended, because suspension implies that there is still work to be done. Therefore, always balance calls to this method with a corresponding call to resume() before disposing of the object. The behavior when releasing the last reference to a dispatch object while it is in a suspended state is undefined.

## See Also

### Activating, Suspending, and Resuming

- [activate()](dispatch/dispatchobject/activate().md)
- [resume()](dispatch/dispatchobject/resume().md)
