---
title: lineLimit
framework: swiftui
role: symbol
role_heading: Instance Property
path: swiftui/environmentvalues/linelimit
---

# lineLimit

The maximum number of lines that text can occupy in a view.

## Declaration

```swift
var lineLimit: Int? { get set }
```

## Discussion

Discussion The maximum number of lines is 1 if the value is less than 1. If the value is nil, the text uses as many lines as required. The default is nil.

## See Also

### Limiting line count for multiline text

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