---
title: "drawKnob(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsslidercell/drawknob(_:)"
---

# drawKnob(_:)

Draws the slider knob in the given rectangle.

## Declaration

```swift
func drawKnob(_ knobRect: NSRect)
```

## Parameters

- `knobRect`: The rectangle in which to draw the slider knob.

## Discussion

Discussion Before this message is sent, a lockFocus() message must be sent to the cell’s control view. You should not call this method explicitly. It’s included so you can override it in a subclass.

## See Also

### Displaying the Cell

- [barRect(flipped:)](appkit/nsslidercell/barrect(flipped:).md)
- [drawTickMarks()](appkit/nsslidercell/drawtickmarks().md)
- [knobRect(flipped:)](appkit/nsslidercell/knobrect(flipped:).md)
- [drawBar(inside:flipped:)](appkit/nsslidercell/drawbar(inside:flipped:).md)
- [drawKnob()](appkit/nsslidercell/drawknob().md)
