---
title: displayIfNeeded()
framework: quartzcore
role: symbol
role_heading: Instance Method
path: quartzcore/calayer/displayifneeded()
---

# displayIfNeeded()

Initiates the update process for a layer if it is currently marked as needing an update.

## Declaration

```swift
func displayIfNeeded()
```

## Discussion

Discussion You can call this method as needed to force an update to your layer’s contents outside of the normal update cycle. Doing so is generally not needed, though. The preferred way to update a layer is to call setNeedsDisplay() and let the system update the layer during the next cycle.

## See Also

### Updating layer display

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