---
title: "addChildBehavior(_:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uidynamicbehavior/addchildbehavior(_:)"
---

# addChildBehavior(_:)

Adds a dynamic behavior, as a child, to a custom dynamic behavior.

## Declaration

```swift
func addChildBehavior(_ behavior: UIDynamicBehavior)
```

## Parameters

- `behavior`: The dynamic behavior you want to add as a child. The parent behavior ignores your use of this method if you: Provide a nil value Provide a behavior instance that you’ve already added to the behavior

## Discussion

Discussion Call this method only on custom subclasses of the UIDynamicBehavior class.

## See Also

### Configuring a dynamic behavior

- [action](uikit/uidynamicbehavior/action.md)
- [childBehaviors](uikit/uidynamicbehavior/childbehaviors.md)
- [removeChildBehavior(_:)](uikit/uidynamicbehavior/removechildbehavior(_:).md)
