---
title: "addInteraction(_:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uiview/addinteraction(_:)"
---

# addInteraction(_:)

Adds an interaction to the view.

## Declaration

```swift
func addInteraction(_ interaction: any UIInteraction)
```

## Parameters

- `interaction`: The interaction object to add to the view.

## See Also

### Adding and removing interactions

- [removeInteraction(_:)](uikit/uiview/removeinteraction(_:).md)
- [interactions](uikit/uiview/interactions.md)
- [UIInteraction](uikit/uiinteraction.md)
