<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTableHeaderCell/drawSortIndicator(withFrame:in:ascending:priority:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSTableHeaderCell(im)drawSortIndicatorWithFrame:inView:ascending:priority:"
  },
  "title" : "drawSortIndicator(withFrame:in:ascending:priority:)"
}
-->

# drawSortIndicator(withFrame:in:ascending:priority:)

Draws a sorting indicator given a cell frame contained inside a view.

```
func drawSortIndicator(withFrame cellFrame: NSRect, in controlView: NSView, ascending: Bool, priority: Int)
```

## Parameters

`cellFrame`

The cell frame.

`controlView`

The control view.

`ascending`

If YES the sort indicator is drawn as ascending; otherwise it is drawn as descending.

`priority`

If `priority` is 0, this is the primary sort indicator.

## Discussion

Override this method to customize the sorting user interface.

## See Also

[`NSTableHeaderCell`](/documentation/AppKit/NSTableHeaderCell)

An object that a table header view uses to draw the content of the column headers.



---

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)