---
title: "velocity(in:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nspangesturerecognizer/velocity(in:)"
---

# velocity(in:)

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

## Declaration

```swift
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

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

## See Also

### Tracking the Location and Velocity of the Gesture

- [translation(in:)](appkit/nspangesturerecognizer/translation(in:).md)
- [setTranslation(_:in:)](appkit/nspangesturerecognizer/settranslation(_:in:).md)
