---
title: flush()
framework: scenekit
role: symbol
role_heading: Type Method
path: scenekit/scntransaction/flush()
---

# flush()

Applies all changes from the current automatic transaction.

## Declaration

```swift
class func flush()
```

## Discussion

Discussion SceneKit automatically calls this method at the end of each pass through the run loop, regardless of the run loop mode. If your app does not have a run loop, you must call this method explicitly. If the current transaction has any nested transactions that are still animating, SceneKit waits to commit the current transaction’s changes until those transactions complete. note: If possible, avoid calling flush() explicitly. By allowing flush() to execute during the run loop, your app achieves better performance, atomic screen updates are preserved, and transactions and animations that work from transaction to transaction continue to function.

## See Also

### Creating and Committing Transactions

- [begin()](scenekit/scntransaction/begin().md)
- [commit()](scenekit/scntransaction/commit().md)
