How do I make a line break with Text() if the text is too long to display in one line? (Something like lineBreakMode in UIKit)
If I type in a long string it just adds „...“ on the right side of the text.
Thanks!
Edit: I tried to combine it with a scroll view to be able to scroll if the text is too long, but if I add a scroll view it ignors .lineLimit()
Code:
ˋˋˋ
struct Homework: View {
var selectedWeek: String
var week: String = "10.-20."
var content: String = "" //Long string inside here
var body: some View {
NavigationView {
ScrollView(isScrollEnabled: true, alwaysBounceHorizontal: false, alwaysBounceVertical: true, showsHorizontalIndicator: false, showsVerticalIndicator: true, content: {
Text(content)
.lineLimit(nil)
})
.navigationBarTitle(Text(week))
}
}
}
ˋˋˋ