---
title: setNeedsDisplay()
framework: uikit
role: symbol
role_heading: Instance Method
path: uikit/uiview/setneedsdisplay()
---

# setNeedsDisplay()

Marks the receiver’s entire bounds rectangle as needing to be redrawn.

## Declaration

```swift
func setNeedsDisplay()
```

## Mentioned in

Updating views automatically with observation tracking

## Discussion

Discussion You can use this method or the setNeedsDisplay(_:) to notify the system that your view’s contents need to be redrawn. This method makes a note of the request and returns immediately. The view is not actually redrawn until the next drawing cycle, at which point all invalidated views are updated. note: If your view is backed by a CAEAGLLayer object, this method has no effect. It is intended for use only with views that use native drawing technologies (such as UIKit and Core Graphics) to render their content. You should use this method to request that a view be redrawn only when the content or appearance of the view change. If you simply change the geometry of the view, the view is typically not redrawn. Instead, its existing content is adjusted based on the value in the view’s contentMode property. Redisplaying the existing content improves performance by avoiding the need to redraw content that has not changed.

## See Also

### Related Documentation

- [contentMode](uikit/uiview/contentmode-swift.property.md)

### Drawing and updating the view

- [draw(_:)](uikit/uiview/draw(_:).md)
- [setNeedsDisplay(_:)](uikit/uiview/setneedsdisplay(_:).md)
- [contentScaleFactor](uikit/uiview/contentscalefactor.md)
- [tintColorDidChange()](uikit/uiview/tintcolordidchange().md)
