<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSSlider/indexOfTickMark(at:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSSlider(im)indexOfTickMarkAtPoint:"
  },
  "title" : "indexOfTickMark(at:)"
}
-->

# indexOfTickMark(at:)

Returns the index of the tick mark closest to the location of the slider represented by the given point.

```
func indexOfTickMark(at point: NSPoint) -> Int
```

## Parameters

`point`

The point representing the location for which to retrieve the tick mark.

## Return Value

The index of the tick mark closest to the location specified by `point`. If `point` is not within the bounding rectangle (plus an extra pixel of space) of any tick mark, the method returns `NSNotFound`.

## Discussion

In its implementation of this method, the receiving `NSSlider` instance invokes the method of the same name of its `NSSliderCell` instance. This method invokes [`rectOfTickMark(at:)`](/documentation/AppKit/NSSlider/rectOfTickMark(at:)) for each tick mark on the slider until it finds a tick mark containing the point.

---

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)