---
title: "closestTickMarkValue(toValue:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsslider/closesttickmarkvalue(tovalue:)"
---

# closestTickMarkValue(toValue:)

Returns the value of the tick mark closest to the specified value.

## Declaration

```swift
func closestTickMarkValue(toValue value: Double) -> Double
```

## Parameters

- `value`: The value for which to return the closest tick mark.

## Return Value

Return Value The value of the tick mark closest to aValue.

## Discussion

Discussion In its implementation of this method, the slider invokes the method of the same name of its NSSliderCell instance.

## See Also

### Managing tick marks

- [allowsTickMarkValuesOnly](appkit/nsslider/allowstickmarkvaluesonly.md)
- [indexOfTickMark(at:)](appkit/nsslider/indexoftickmark(at:).md)
- [numberOfTickMarks](appkit/nsslider/numberoftickmarks.md)
- [rectOfTickMark(at:)](appkit/nsslider/rectoftickmark(at:).md)
- [tickMarkPosition](appkit/nsslider/tickmarkposition-swift.property.md)
- [NSSlider.TickMarkPosition](appkit/nsslider/tickmarkposition-swift.enum.md)
- [tickMarkValue(at:)](appkit/nsslider/tickmarkvalue(at:).md)
