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

# drawKnob()

Calculates the rectangle in which the knob should be drawn, then calls drawKnob(_:) to actually draw the knob.

## Declaration

```swift
func drawKnob()
```

## Discussion

Discussion Before this message is sent, a lockFocus method must be sent to the cell’s control view. You might call this method if you override one of the display methods belonging to NSControl or NSCell. Special Considerations If you create a subclass of NSSliderCell, don’t override this method. Override drawKnob(_:) instead.

## 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)
