---
title: CGImageSourceAnimationBlock
framework: imageio
role: symbol
role_heading: Type Alias
path: imageio/cgimagesourceanimationblock
---

# CGImageSourceAnimationBlock

The block to execute for each frame of an image animation.

## Declaration

```swift
typealias CGImageSourceAnimationBlock = (Int, CGImage, UnsafeMutablePointer<Bool>) -> Void
```

## Parameters

- `index`: The index of the image in the file.
- `image`: The image to display.
- `stop`: A Boolean flag set to false on input. To stop the animation, set the value of this parameter to true.

## Discussion

Discussion During the animation of an image, the system calls this block for each successive frame of the animation. Use this block to display the new image in your app’s interface, and to update any additional details.

## See Also

### Animations

- [CGAnimateImageAtURLWithBlock(_:_:_:)](imageio/cganimateimageaturlwithblock(_:_:_:).md)
- [CGAnimateImageDataWithBlock(_:_:_:)](imageio/cganimateimagedatawithblock(_:_:_:).md)
- [kCGImageAnimationStartIndex](imageio/kcgimageanimationstartindex.md)
- [kCGImageAnimationDelayTime](imageio/kcgimageanimationdelaytime.md)
- [kCGImageAnimationLoopCount](imageio/kcgimageanimationloopcount.md)
- [CGImageAnimationStatus](imageio/cgimageanimationstatus.md)
