<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSAnimationDelegate/animation(_:valueForProgress:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSAnimationDelegate(im)animation:valueForProgress:"
  },
  "title" : "animation(_:valueForProgress:)"
}
-->

# animation(_:valueForProgress:)

Requests a custom curve value for the current progress value.

```
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

A `float` value representing a custom curve.

## 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`](/documentation/AppKit/NSAnimation/currentValue) message. The value the delegate returns is used as the value of [`currentValue`](/documentation/AppKit/NSAnimation/currentValue); if there is no delegate, or it doesn’t implement animation:valueForProgress:, `NSAnimation` computes and returns the current value. `NSAnimation` does not invoke [`currentValue`](/documentation/AppKit/NSAnimation/currentValue)itself, but subclasses might.

See the description of [`currentValue`](/documentation/AppKit/NSAnimation/currentValue) for more information.

## See Also

[`var currentValue: Float`](/documentation/AppKit/NSAnimation/currentValue)

The current value of the animation effect, based on the current progress



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)