setAngle(_:magnitude:)
Sets the angle and magnitude of the force vector for the behavior.
Declaration
func setAngle(_ angle: CGFloat, magnitude: CGFloat)Parameters
- angle:
The angle, in radians, of the force vector for the push behavior.
The default angle is
0radians, 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 of1.0, applied to a 100 point x 100 point view whose density value is1.0, results in view acceleration of 100 points / second².Setting the 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.