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

# velocity(in:)

The velocity of the pan, measured in points per second.

```
func velocity(in view: NSView?) -> NSPoint
```

## Parameters

`view`

The view that provides the coordinate system for computing the velocity value. This parameter must not be `nil`.

## Return Value

The horizontal and vertical velocity of the pan gesture. These values are relative to the specified view.

## Discussion

---

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)