<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIFieldBehavior/velocityField(direction:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIFieldBehavior(cm)velocityFieldWithVector:"
  },
  "title" : "velocityField(direction:)"
}
-->

# velocityField(direction:)

Creates and returns a field behavior object that applies a directional velocity to items.

```
class func velocityField(direction: CGVector) -> Self
```

## Parameters

`direction`

The vector indicating the direction of the velocity force. You can change this value later by modifying the [`direction`](/documentation/UIKit/UIFieldBehavior/direction) property.

## Return Value

A field behavior object that applies a velocity to items.

## Discussion

Velocity fields apply their velocity to the item, overriding any other acceleration forces currently on the item. The vector in the `direction` parameter is combined with the field [`strength`](/documentation/UIKit/UIFieldBehavior/strength) to determine the velocity of items in the field.

---

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)