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

# canDraw

A Boolean value indicating whether drawing commands will produce any results.

```
var canDraw: Bool { get }
```

## Discussion

The value of this property is <doc://com.apple.documentation/documentation/Swift/true> when drawing produces expected results. A view object can draw onscreen if it is not hidden, it is attached to a view hierarchy in a window ([`NSWindow`](/documentation/AppKit/NSWindow)), and the window has a corresponding window device. A view object can also draw during printing if it is a descendant of the view being printed.

Check the value of this property before attempting to force drawing to a specific context. For example, if the value of this property is <doc://com.apple.documentation/documentation/Swift/false>, do not call [`lockFocus()`](/documentation/AppKit/NSView/lockFocus()) or do issue any drawing commands from the view. You do not need to check whether drawing can occur when calling the [`display()`](/documentation/AppKit/NSView/display()) method or any of its related methods. The display methods perform appropriate checks before asking the view to draw itself.

## See Also

[`hidden`](/documentation/AppKit/NSView/isHidden)

A Boolean value indicating whether the view is hidden.



---

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)