<!--
{
  "availability" : [
    "iOS: 7.0.0 -",
    "iPadOS: 7.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UICollisionBehavior/addBoundary(withIdentifier:for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UICollisionBehavior(im)addBoundaryWithIdentifier:forPath:"
  },
  "title" : "addBoundary(withIdentifier:for:)"
}
-->

# addBoundary(withIdentifier:for:)

Adds a collision boundary, specified as a Bezier path, to the collision behavior.

```
func addBoundary(withIdentifier identifier: any NSCopying, for bezierPath: UIBezierPath)
```

## Parameters

`identifier`

An arbitrary identifier for the boundary you are adding.

`bezierPath`

An arbitrary Bezier path that specifies the collision boundary you are adding.

    The coordinate system and origin point for the path depend on how you’ve initialized the dynamic animator (that you’re adding the behavior to). See the overview in [`UIDynamicAnimator`](/documentation/UIKit/UIDynamicAnimator)     for more information.

## Discussion

---

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)