---
title: "setCompletionBlock(_:)"
framework: quartzcore
role: symbol
role_heading: Type Method
path: "quartzcore/catransaction/setcompletionblock(_:)"
---

# setCompletionBlock(_:)

Sets the completion block object.

## Declaration

```swift
class func setCompletionBlock(_ block: (() -> Void)?)
```

## Parameters

- `block`: A block object called when animations for this transaction group are completed. The block object takes no parameters and returns no value.

## Discussion

Discussion The completion block object that is guaranteed to be called (on the main thread) as soon as all animations subsequently added by this transaction group have completed (or have been removed.) If no animations are added before the current transaction group is committed (or the completion block is set to a different value,) the block will be invoked immediately.

## See Also

### Getting and Setting Completion Block Objects

- [completionBlock()](quartzcore/catransaction/completionblock().md)
