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

# setAngle(_:magnitude:)

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

```
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 [`magnitude`](/documentation/UIKit/UIPushBehavior/magnitude)     parameter to a negative value reverses the direction of the force.

## 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.

---

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)