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

# canDrawSubviewsIntoLayer

A Boolean value indicating whether the view incorporates content from its subviews into its own layer.

```
var canDrawSubviewsIntoLayer: Bool { get set }
```

## Discussion

When the value of this property is <doc://com.apple.documentation/documentation/Swift/true>, any subviews that have an implicitly created layer—that is, layers for which you did not explicitly set the [`wantsLayer`](/documentation/AppKit/NSView/wantsLayer) property to <doc://com.apple.documentation/documentation/Swift/true>—draw their contents into the current view’s layer. In other words, the subviews do not get a layer of their own. Instead, they draw their content into the parent view’s layer. All views involved in the operation draw their content using their [`draw(_:)`](/documentation/AppKit/NSView/draw(_:)) method. They do not use the [`updateLayer()`](/documentation/AppKit/NSView/updateLayer()) method to update their layer contents, even if the [`wantsUpdateLayer`](/documentation/AppKit/NSView/wantsUpdateLayer) property is set to <doc://com.apple.documentation/documentation/Swift/true>.

Use this property to flatten the layer hierarchy for a layer-backed view and its subviews. Flattening a layer hierarchy reduces the number of layers (and may reduce the amount of memory) used by your view hierarchy. Reducing the number of layers can be more efficient in situations where there is significant overlap among the subviews or where the content of the view and subviews does not change significantly. For example, flattening a hierarchy reduces the amount of time spent compositing your views together. Do not flatten a view hierarchy if you plan to animate one or more subviews in that hierarchy.

When changing the value of this property, the current view must have a layer object. The default value of this property is <doc://com.apple.documentation/documentation/Swift/false>.

---

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)