<!--
{
  "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/CAAnimation/shouldArchiveValue(forKey:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core Animation"
    ],
    "preciseIdentifier" : "c:objc(cs)CAAnimation(im)shouldArchiveValueForKey:"
  },
  "title" : "shouldArchiveValue(forKey:)"
}
-->

# shouldArchiveValue(forKey:)

Specifies whether the value of the property for a given key is archived.

```
func shouldArchiveValue(forKey key: String) -> Bool
```

## Parameters

`key`

The name of one of the receiver’s properties.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the specified property should be archived, otherwise <doc://com.apple.documentation/documentation/Swift/false>.

## Discussion

Called by the object’s implementation of `encodeWithCoder:`. The object must implement keyed archiving.

The default implementation returns <doc://com.apple.documentation/documentation/Swift/true>.

## See Also

  [Core Animation Programming Guide](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/CoreAnimation_guide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40004514)



---

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)