---
title: "MPSImageBatchIterate(_:_:)"
framework: metalperformanceshaders
role: symbol
role_heading: Function
path: "metalperformanceshaders/mpsimagebatchiterate(_:_:)"
---

# MPSImageBatchIterate(_:_:)

Executes a callback block once for each unique image in a batch.

## Declaration

```swift
func MPSImageBatchIterate(_ batch: [MPSImage], _ iteratorBlock: @escaping (MPSImage, Int) -> Int) -> Int
```
