<!--
{
  "availability" : [
    "iOS: 7.0.0 -",
    "iPadOS: 7.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIGravityBehavior/gravityDirection",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIGravityBehavior(py)gravityDirection"
  },
  "title" : "gravityDirection"
}
-->

# gravityDirection

The direction and magnitude of the gravitational force, expressed as a vector.

```
var gravityDirection: CGVector { get set }
```

## Discussion

The gravity vector is expressed as an *x, y* pair that represents the relative motion along the x and y axes of the reference view. A value of `1.0` corresponds to an acceleration of 1000 points / second², which is referred to as UIKit gravity and approximates the Earth’s own gravitational force. A value of `-1.0` represents the same amount of force, but in the opposite direction of the corresponding axis.

The default value of this property is the vector (`0.0, 1.0`), which represents a downward force in the reference view. Changing the [`angle`](/documentation/UIKit/UIGravityBehavior/angle) or [`magnitude`](/documentation/UIKit/UIGravityBehavior/magnitude) values also changes the value of this property.

---

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)