Initializes a behavior where the specified point in a dynamic item is attached to an anchor point.
- iOS 7.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
The dynamic item to attach to the specified
The offset from the center of
itemat which to create the attachment. Specifying
zerocreates the attachment at the center of
The anchor point for the item. Specify this point in the coordinate system of the dynamic animator’s reference view. For more information about coordinate systems, see
The initialized attachment behavior, or
nil if there was a problem initializing the object.
The behavior created by this method acts like a solid rod connecting the item to the specified anchor point. The item is free to rotate around the anchor point, but its distance to the anchor point remains fixed. If you specify a nonzero offset value, the item is connected at the specified point instead of the center of the item.
The attachment object returned by this method is of type