<!--
{
  "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/CALayer/needsDisplay(forKey:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Core Animation"
    ],
    "preciseIdentifier" : "c:objc(cs)CALayer(cm)needsDisplayForKey:"
  },
  "title" : "needsDisplay(forKey:)"
}
-->

# needsDisplay(forKey:)

Returns a Boolean indicating whether changes to the specified key require the layer to be redisplayed.

```
class func needsDisplay(forKey key: String) -> Bool
```

## Parameters

`key`

A string that specifies an attribute of the layer.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the layer requires a redisplay.

## Discussion

Subclasses can override this method and return <doc://com.apple.documentation/documentation/Swift/true> if the layer should be redisplayed when the value of the specified attribute changes. Animations changing the value of the attribute also trigger redisplay.

The default implementation of this method returns <doc://com.apple.documentation/documentation/Swift/false>.

## See Also

[`defaultAction(forKey:)`](/documentation/QuartzCore/CALayer/defaultAction(forKey:))

Returns the default action for the current class.

[`defaultValue(forKey:)`](/documentation/QuartzCore/CALayer/defaultValue(forKey:))

Specifies the default value associated with the specified 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)