<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSView/opaqueAncestor",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSView(py)opaqueAncestor"
  },
  "title" : "opaqueAncestor"
}
-->

# opaqueAncestor

The view’s closest opaque ancestor, which might be the view itself.

```
unowned(unsafe) var opaqueAncestor: NSView? { get }
```

## See Also

[`-  displayIfNeededIgnoringOpacity`](/documentation/AppKit/NSView/displayIfNeededIgnoringOpacity())

Acts as [`displayIfNeeded()`](/documentation/AppKit/NSView/displayIfNeeded()), except that this method doesn’t back up to the first opaque ancestor—it simply causes the view and its descendants to execute their drawing code.

[`-  displayRectIgnoringOpacity:`](/documentation/AppKit/NSView/displayIgnoringOpacity(_:))

Displays the view but confines drawing to a specified region and does not back up to the first opaque ancestor—it simply causes the view and its descendants to execute their drawing code.

[`-  displayIfNeededInRectIgnoringOpacity:`](/documentation/AppKit/NSView/displayIfNeededIgnoringOpacity(_:))

Acts as [`displayIfNeeded()`](/documentation/AppKit/NSView/displayIfNeeded()), but confining drawing to `aRect` and not backing up to the first opaque ancestor—it simply causes the view and its descendants to execute their drawing code.

[`opaque`](/documentation/AppKit/NSView/isOpaque)

A Boolean value indicating whether the view fills its frame rectangle with opaque content.



---

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)