Instance Method

addAngularVelocity(_:for:)

Adds a specified angular velocity to a dynamic item.

Declaration

func addAngularVelocity(_ velocity: CGFloat, for item: UIDynamicItem)

Parameters

velocity

The angular velocity, expressed in radians per second, that you want to add to the specified dynamic item. Default value is 0. Applying a negative value reduces the angular velocity by the specified amount.

item

The dynamic item whose angular velocity you want to increase (or decrease).

See Also

Configuring a Dynamic Item Behavior

func addLinearVelocity(CGPoint, for: UIDynamicItem)

Adds a specified linear velocity to a dynamic item.

var allowsRotation: Bool

Specifies whether rotation is allowed for the behavior’s dynamic items.

var angularResistance: CGFloat

The angular resistance for the behavior’s dynamic items.

func angularVelocity(for: UIDynamicItem) -> CGFloat

Returns the angular velocity for a specified dynamic item.

func linearVelocity(for: UIDynamicItem) -> CGPoint

Returns the linear velocity for a specified dynamic item.

var density: CGFloat

The relative mass density of the behavior’s dynamic items.

var elasticity: CGFloat

The amount of elasticity applied to collisions for the behavior’s dynamic items.

var friction: CGFloat

The linear resistance for the behavior’s dynamic items when two slide against each other.

var resistance: CGFloat

The linear resistance for the behavior’s dynamic items, which reduces their linear velocity over time.

var charge: CGFloat

The charge associated with the item.

var isAnchored: Bool

A Boolean value indicating whether the item is anchored to its current position.