---
title: "insertView(_:at:animated:)"
framework: CareKit
role: symbol
role_heading: Instance Method
platforms: [iOS 13.0+, Mac Catalyst 13.0+, watchOS 7.0+]
path: "carekit/ocklistviewcontroller/insertview(_:at:animated:)"
---

# insertView(_:at:animated:)

Inserts a view into the vertical stack of list views at a specific index.

## Declaration

```swift
func insertView(_ view: UIView, at index: Int, animated: Bool)
```

## Parameters

- `view`: The view to insert in the list.
- `index`: The index at which to insert view. This value must not be greater than the number of views in the OCKListViewController. If the index is out of bounds, this method throws an internalInconsistencyException exception.
- `animated`: A Boolean value that indicates whether to animate the insertion of view.

## See Also

### Inserting in the list

- [insertViewController(_:at:animated:)](carekit/ocklistviewcontroller/insertviewcontroller(_:at:animated:).md)
