<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.5.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "QuartzCore",
  "identifier" : "/documentation/QuartzCore/CATransaction/setAnimationDuration(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Core Animation"
    ],
    "preciseIdentifier" : "c:objc(cs)CATransaction(cm)setAnimationDuration:"
  },
  "title" : "setAnimationDuration(_:)"
}
-->

# setAnimationDuration(_:)

Sets the animation duration used by all animations within this transaction group.

```
class func setAnimationDuration(_ dur: CFTimeInterval)
```

## Parameters

`dur`

An interval of time used as the duration.

## Discussion

You can also set the animation duration for a specific transaction object by calling the [`setValue(_:forKey:)`](/documentation/QuartzCore/CATransaction/setValue(_:forKey:)) method of that object and specifying the [`kCATransactionAnimationDuration`](/documentation/QuartzCore/kCATransactionAnimationDuration) key.

---

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)