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

# setAngle(_:magnitude:)

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

## Declaration

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

## Parameters

- `angle`: The angle, in radians, of the force vector for the push behavior. The default angle is 0 radians, using standard UIKit geometry.
- `magnitude`: The magnitude of the force vector for the push behavior. The default magnitude is nil, equivalent to no force. A force vector with a magnitude of 1.0, applied to a 100 point x 100 point view whose density value is 1.0, results in view acceleration of 100 points / second². Setting the doc://com.apple.uikit/documentation/UIKit/UIPushBehavior/magnitude parameter to a negative value reverses the direction of the force.

## Discussion

Discussion Whether you express a push behavior’s force direction in terms of radian angle or with x, y components, the alternate, equivalent values update automatically.

## See Also

### Configuring a push behavior

- [angle](uikit/uipushbehavior/angle.md)
- [magnitude](uikit/uipushbehavior/magnitude.md)
- [mode](uikit/uipushbehavior/mode-swift.property.md)
- [setTargetOffsetFromCenter(_:for:)](uikit/uipushbehavior/settargetoffsetfromcenter(_:for:).md)
- [targetOffsetFromCenter(for:)](uikit/uipushbehavior/targetoffsetfromcenter(for:).md)
- [pushDirection](uikit/uipushbehavior/pushdirection.md)
