---
title: "needsToDraw(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsview/needstodraw(_:)"
---

# needsToDraw(_:)

Returns a Boolean value indicating whether the specified rectangle intersects any part of the area that the view is being asked to draw.

## Declaration

```swift
func needsToDraw(_ rect: NSRect) -> Bool
```

## Parameters

- `rect`: A rectangle defining a region of the view.

## Discussion

Discussion You typically send this message from within a draw(_:) implementation. It gives you a convenient way to determine whether any part of a given graphical entity might need to be drawn. It is optimized to efficiently reject any rectangle that lies outside the bounding box of the area that the view is being asked to draw in draw(_:).

## See Also

### Drawing the View’s Content

- [updateLayer()](appkit/nsview/updatelayer().md)
- [draw(_:)](appkit/nsview/draw(_:).md)
- [clipsToBounds](appkit/nsview/clipstobounds.md)
- [canDrawConcurrently](appkit/nsview/candrawconcurrently.md)
- [visibleRect](appkit/nsview/visiblerect.md)
- [getRectsBeingDrawn(_:count:)](appkit/nsview/getrectsbeingdrawn(_:count:).md)
- [wantsDefaultClipping](appkit/nsview/wantsdefaultclipping.md)
- [bitmapImageRepForCachingDisplay(in:)](appkit/nsview/bitmapimagerepforcachingdisplay(in:).md)
- [cacheDisplay(in:to:)](appkit/nsview/cachedisplay(in:to:).md)
- [NSBorderType](appkit/nsbordertype.md)
