---
title: "addBoundary(withIdentifier:for:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uicollisionbehavior/addboundary(withidentifier:for:)"
---

# addBoundary(withIdentifier:for:)

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

## Declaration

```swift
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 doc://com.apple.uikit/documentation/UIKit/UIDynamicAnimator for more information.

## See Also

### Configuring a collision behavior

- [addBoundary(withIdentifier:from:to:)](uikit/uicollisionbehavior/addboundary(withidentifier:from:to:).md)
- [boundaryIdentifiers](uikit/uicollisionbehavior/boundaryidentifiers.md)
- [boundary(withIdentifier:)](uikit/uicollisionbehavior/boundary(withidentifier:).md)
- [collisionMode](uikit/uicollisionbehavior/collisionmode.md)
- [removeAllBoundaries()](uikit/uicollisionbehavior/removeallboundaries().md)
- [removeBoundary(withIdentifier:)](uikit/uicollisionbehavior/removeboundary(withidentifier:).md)
- [setTranslatesReferenceBoundsIntoBoundary(with:)](uikit/uicollisionbehavior/settranslatesreferenceboundsintoboundary(with:).md)
- [translatesReferenceBoundsIntoBoundary](uikit/uicollisionbehavior/translatesreferenceboundsintoboundary.md)
