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

# testPart(_:)

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

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

## Discussion

See [`NSScroller.Part`](/documentation/AppKit/NSScroller/Part) for a list of possible return values. In macOS 10.7 and later, this method no longer returns [`NSScroller.Part.incrementLine`](/documentation/AppKit/NSScroller/Part/incrementLine) or [`NSScroller.Part.decrementLine`](/documentation/AppKit/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

[`hitPart`](/documentation/AppKit/NSScroller/hitPart)

A part code indicating the manner in which the scrolling should be performed.



---

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)