---
title: "animationDidStop(_:finished:)"
framework: quartzcore
role: symbol
role_heading: Instance Method
path: "quartzcore/caanimationdelegate/animationdidstop(_:finished:)"
---

# animationDidStop(_:finished:)

Tells the delegate the animation has ended.

## Declaration

```swift
optional func animationDidStop(_ anim: CAAnimation, finished flag: Bool)
```

## Parameters

- `anim`: The doc://com.apple.quartzcore/documentation/QuartzCore/CAAnimation object that has ended.
- `flag`: A flag indicating whether the animation has completed by reaching the end of its duration.

## Discussion

Discussion The animation may have ended because it has completed its active duration or because it has been removed from the layer it is attached to. flag is true if the animation reached the end of its duration without being removed.

## See Also

### Customizing Start and Stop Times

- [animationDidStart(_:)](quartzcore/caanimationdelegate/animationdidstart(_:).md)
