---
title: "lineLimit(_:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/view/linelimit(_:)"
---

# lineLimit(_:)

Sets to a closed range the number of lines that text can occupy in this view.

## Declaration

```swift
nonisolated func lineLimit(_ limit: ClosedRange<Int>) -> some View

```

## Parameters

- `limit`: The line limit.

## Discussion

Discussion Use this modifier to specify a closed range of lines that a Text view or a vertical TextField can occupy. When the text of such views occupies more space than the provided limit, a Text view truncates its content while a TextField becomes scrollable. Form {     TextField("Title", text: $model.title)     TextField("Notes", text: $model.notes, axis: .vertical)         .lineLimit(1...3) }

## See Also

### Limiting line count for multiline text

- [lineLimit(_:reservesSpace:)](swiftui/view/linelimit(_:reservesspace:).md)
- [lineLimit](swiftui/environmentvalues/linelimit.md)
