---
title: "addExecutionBlock(_:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/blockoperation/addexecutionblock(_:)"
---

# addExecutionBlock(_:)

Adds the specified block to the receiver’s list of blocks to perform.

## Declaration

```swift
func addExecutionBlock(_ block: @escaping @Sendable () -> Void)
```

## Parameters

- `block`: The block to add to the receiver’s list. The block should take no parameters and have no return value.

## Discussion

Discussion The specified block should not make any assumptions about its execution environment. Calling this method while the receiver is executing or has already finished causes an NSInvalidArgumentException exception to be thrown.

## See Also

### Managing the Blocks in the Operation

- [init(block:)](foundation/blockoperation/init(block:).md)
- [executionBlocks](foundation/blockoperation/executionblocks.md)
