<!--
{
  "availability" : [
    "macOS: 10.7.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSAnimationContext/timingFunction",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSAnimationContext(py)timingFunction"
  },
  "title" : "timingFunction"
}
-->

# timingFunction

The timing function used for all animations within this animation proxy group.

```
var timingFunction: CAMediaTimingFunction? { get set }
```

## Discussion

The NSAnimationContext timing function is analogous to the CATransaction <doc://com.apple.documentation/documentation/QuartzCore/CATransaction/setAnimationTimingFunction(_:)> method.

Animations initiated through the “animator” proxy syntax, that do not have an explicitly specified timing functions, will inherit the enclosing `NSAnimationContext` instance’s [`timingFunction`](/documentation/AppKit/NSAnimationContext/timingFunction) if it is not `nil` (which is the default).

As with the existing [`duration`](/documentation/AppKit/NSAnimationContext/duration) property, changing a timing function causes the same change in the underlying CATransaction instance’s <doc://com.apple.documentation/documentation/QuartzCore/CATransaction/animationTimingFunction()>.

Also as with the [`duration`](/documentation/AppKit/NSAnimationContext/duration) property, you may change the timingFunction any number of times within a given NSAnimationContext [`beginGrouping()`](/documentation/AppKit/NSAnimationContext/beginGrouping()) and [`endGrouping()`](/documentation/AppKit/NSAnimationContext/endGrouping()) block. Changes to the `timingFunction` will apply to any animations that are subsequently initiated in that NSAnimationContext grouping, until the `timingFunction` is possibly changed again.

---

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)