---
title: display()
framework: appkit
role: symbol
role_heading: Instance Method
path: appkit/nsview/display()
---

# display()

Displays the view and all its subviews if possible, invoking each of the NSView methods lockFocus(), draw(_:), and unlockFocus() as necessary.

## Declaration

```swift
func display()
```

## Discussion

Discussion If the view isn’t opaque, this method backs up the view hierarchy to the first opaque ancestor, calculates the portion of the opaque ancestor covered by the view, and begins displaying from there.

## See Also

### Related Documentation

- [canDraw](appkit/nsview/candraw.md)
- [visibleRect](appkit/nsview/visiblerect.md)
- [opaqueAncestor](appkit/nsview/opaqueancestor.md)

### Invalidating the View’s Content

- [setNeedsDisplay(_:)](appkit/nsview/setneedsdisplay(_:).md)
- [needsDisplay](appkit/nsview/needsdisplay.md)
- [display(_:)](appkit/nsview/display(_:).md)
- [displayIgnoringOpacity(_:)](appkit/nsview/displayignoringopacity(_:).md)
- [displayIgnoringOpacity(_:in:)](appkit/nsview/displayignoringopacity(_:in:).md)
- [displayIfNeeded()](appkit/nsview/displayifneeded().md)
- [displayIfNeeded(_:)](appkit/nsview/displayifneeded(_:).md)
- [displayIfNeededIgnoringOpacity()](appkit/nsview/displayifneededignoringopacity().md)
- [displayIfNeededIgnoringOpacity(_:)](appkit/nsview/displayifneededignoringopacity(_:).md)
- [translateRectsNeedingDisplay(in:by:)](appkit/nsview/translaterectsneedingdisplay(in:by:).md)
- [isOpaque](appkit/nsview/isopaque.md)
- [viewWillDraw()](appkit/nsview/viewwilldraw().md)
