<!--
{
  "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/magnitude",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIGravityBehavior(py)magnitude"
  },
  "title" : "magnitude"
}
-->

# magnitude

The magnitude of the gravity vector.

```
var magnitude: CGFloat { get set }
```

## Discussion

Modify this property when you want to change the magnitude of the gravity vector separately from the angle of that vector. A magnitude value of `1.0` represents an acceleration of 1000 points / second² at the specified angle, which roughly approximates the force of Earth’s gravity. The value in this property is tied to the value in the [`gravityDirection`](/documentation/UIKit/UIGravityBehavior/gravityDirection) property, so changes in one affect the other.

The default value of this property is `1.0`.

> Important:
> Setting the value of this property to `0.0` creates the vector (`0.0`, `0.0`) and resets the ``doc://com.apple.uikit/documentation/UIKit/UIGravityBehavior/angle`` property to `0.0` radians. If you make subsequent changes to this property, also remember to update the ``doc://com.apple.uikit/documentation/UIKit/UIGravityBehavior/angle`` 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)