Avoiding text truncation in SwiftUI with Dynamic Type
When testing Breve with Dynamic Type, I noticed that in some layouts, text would get truncated at larger text sizes instead of wrapping onto the next line, even when there is no line limit and no vertical size constraint on the element. Text truncation can still occur even when the UI element containing the text is inside a scroll view and can grow infinitely.


I had run into similar truncation issues before, but they seem to have become more frequent in iOS 26.
To ensure that text doesn't truncate, I had to apply the fixedSize(horizontal:vertical:) modifier to the text view, passing false
for the horizontal
parameter and true
for the vertical
one. This tells the text to respect horizontal size constraints so it wraps normally, while at the same time forcing it to ignore vertical constraints and expand as needed.
Text(drink.description)
.fixedSize(
horizontal: false,
vertical: true
)


When using this workaround, make sure the layout can grow vertically as much as required, even at the largest accessibility sizes, so the text doesn't get cut off.