---
title: "needsDisplay(forKey:)"
framework: quartzcore
role: symbol
role_heading: Type Method
path: "quartzcore/calayer/needsdisplay(forkey:)"
---

# needsDisplay(forKey:)

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

## Declaration

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

## Parameters

- `key`: A string that specifies an attribute of the layer.

## Return Value

Return Value true if the layer requires a redisplay.

## Discussion

Discussion Subclasses can override this method and return 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 false.

## See Also

### Related Documentation

- [defaultAction(forKey:)](quartzcore/calayer/defaultaction(forkey:).md)
- [defaultValue(forKey:)](quartzcore/calayer/defaultvalue(forkey:).md)

### Updating layer display

- [setNeedsDisplay()](quartzcore/calayer/setneedsdisplay().md)
- [setNeedsDisplay(_:)](quartzcore/calayer/setneedsdisplay(_:).md)
- [needsDisplayOnBoundsChange](quartzcore/calayer/needsdisplayonboundschange.md)
- [displayIfNeeded()](quartzcore/calayer/displayifneeded().md)
- [needsDisplay()](quartzcore/calayer/needsdisplay().md)
