---
title: "init(frame:textContainer:)"
framework: uikit
role: symbol
role_heading: Initializer
path: "uikit/uitextview/init(frame:textcontainer:)"
---

# init(frame:textContainer:)

Creates a new text view with the specified text container.

## Declaration

```swift
init(frame: CGRect, textContainer: NSTextContainer?)
```

## Parameters

- `frame`: The frame rectangle of the text view.
- `textContainer`: The text container to use for the receiver (can be nil).

## Return Value

Return Value An initialized text view.

## Discussion

Discussion This is the designated initializer for UITextView objects.

## See Also

### Initializing the text view

- [init(usingTextLayoutManager:)](uikit/uitextview/init(usingtextlayoutmanager:).md)
- [init(coder:)](uikit/uitextview/init(coder:).md)
