Contents

fixedAttachment(with:attachedTo:attachmentAnchor:)

Creates and returns an attachment behavior where the two items are fixed together through the specified anchor point.

Declaration

class func fixedAttachment(with item1: any UIDynamicItem, attachedTo item2: any UIDynamicItem, attachmentAnchor point: CGPoint) -> Self

Parameters

  • item1:

    The first of two dynamic items connected by the attachment behavior.

  • item2:

    The second of two dynamic items connected by the attachment behavior.

  • point:

    The anchor point for both items. Specify this point in the coordinate system of the dynamic animator’s reference view. For more information about coordinate systems, see Uidynamicanimator.

Return Value

A new attachment object or nil if the object could not be created.

Discussion

The behavior created by this method acts like a solid rod connecting each item to the specified anchor point. The position of the items relative to each other does not change. Forces acting on the items move them together as if they were a single unit.

See Also

Creating and initializing attachment behavior objects