---
title: "animation(_:valueForProgress:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsanimationdelegate/animation(_:valueforprogress:)"
---

# animation(_:valueForProgress:)

Requests a custom curve value for the current progress value.

## Declaration

```swift
nonisolated optional func animation(_ animation: NSAnimation, valueForProgress progress: NSAnimation.Progress) -> Float
```

## Parameters

- `animation`: An NSAnimation object that is running.
- `progress`: A float value (typed as NSAnimationProgress) that indicates a progress mark of animation. This value is always between 0.0 and 1.0.

## Return Value

Return Value A float value representing a custom curve.

## Discussion

Discussion The delegate can compute and return a custom curve value for the given progress value.  If the delegate does not implement this method, NSAnimation computes the current curve value. The animation:valueForProgress: message is sent to the delegate when an NSAnimation object receives a currentValue message. The value the delegate returns is used as the value of currentValue; if there is no delegate, or it doesn’t implement animation:valueForProgress:, NSAnimation computes and returns the current value. NSAnimation does not invoke currentValueitself, but subclasses might. See the description of currentValue for more information.

## See Also

### Related Documentation

- [currentValue](appkit/nsanimation/currentvalue.md)

### Controlling and Monitoring an Animation

- [animationDidEnd(_:)](appkit/nsanimationdelegate/animationdidend(_:).md)
- [animationDidStop(_:)](appkit/nsanimationdelegate/animationdidstop(_:).md)
- [animationShouldStart(_:)](appkit/nsanimationdelegate/animationshouldstart(_:).md)
