---
title: "setAngle(_:magnitude:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uigravitybehavior/setangle(_:magnitude:)"
---

# setAngle(_:magnitude:)

Sets the angle and magnitude of the gravity vector for the behavior.

## Declaration

```swift
func setAngle(_ angle: CGFloat, magnitude: CGFloat)
```

## Parameters

- `angle`: The radian angle for the gravity vector, using standard UIKit geometry. Specify the value pi / 2 to create a force that pulls items downward toward the bottom of the reference view.
- `magnitude`: The magnitude of the gravitational force. Specify 1.0 to get the standard UIKit gravity, which has an acceleration value of 1000 points / second².

## See Also

### Configuring a gravity behavior

- [gravityDirection](uikit/uigravitybehavior/gravitydirection.md)
- [angle](uikit/uigravitybehavior/angle.md)
- [magnitude](uikit/uigravitybehavior/magnitude.md)
