<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIAttachmentBehavior/fixedAttachment(with:attachedTo:attachmentAnchor:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIAttachmentBehavior(cm)fixedAttachmentWithItem:attachedToItem:attachmentAnchor:"
  },
  "title" : "fixedAttachment(with:attachedTo:attachmentAnchor:)"
}
-->

# fixedAttachment(with:attachedTo:attachmentAnchor:)

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

```
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`](/documentation/UIKit/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.

---

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)