---
title: magnitude
framework: uikit
role: symbol
role_heading: Instance Property
path: uikit/uigravitybehavior/magnitude
---

# magnitude

The magnitude of the gravity vector.

## Declaration

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

## Discussion

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 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 angle property to 0.0 radians. If you make subsequent changes to this property, also remember to update the angle property.

## See Also

### Configuring a gravity behavior

- [gravityDirection](uikit/uigravitybehavior/gravitydirection.md)
- [angle](uikit/uigravitybehavior/angle.md)
- [setAngle(_:magnitude:)](uikit/uigravitybehavior/setangle(_:magnitude:).md)
