---
title: "testPart(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsscroller/testpart(_:)"
---

# testPart(_:)

Returns the part that would be hit by a mouse-down event at aPoint (expressed in the window’s coordinate system).

## Declaration

```swift
func testPart(_ point: NSPoint) -> NSScroller.Part
```

## Discussion

Discussion See NSScroller.Part for a list of possible return values. In macOS 10.7 and later, this method no longer returns NSScroller.Part.incrementLine or NSScroller.Part.decrementLine. Note the interpretations of NSScrollerDecrementPage and NSScrollerIncrementPage. The actual part of a scroller that causes page-by-page scrolling varies, so as a convenience these part codes refer to useful parts different from the scroll buttons.

## See Also

### Related Documentation

- [hitPart](appkit/nsscroller/hitpart.md)

### Calculating Layout

- [rect(for:)](appkit/nsscroller/rect(for:).md)
- [checkSpaceForParts()](appkit/nsscroller/checkspaceforparts().md)
- [usableParts](appkit/nsscroller/usableparts-swift.property.md)
