this gives me dynamic text height correctly
import SwiftUI
struct ContentView : View {
var body: some View {
List {
Text("This is some very long text can we can see scrolls past two lines ").lineLimit(nil)
}
}
}
#if DEBUG
struct ContentView_Previews : PreviewProvider {
static var previews: some View {
ContentView()
}
}
#endif
But the following truncates the Text. How do i get dynamic height with the following?
import SwiftUI
struct ContentView : View {
var body: some View {
GeometryReader { reader in
ScrollView {
Text("This is some very long text can we can see scrolls past two lines ")
.lineLimit(nil)
.frame(width: reader.size.width)
}
}
}
}
#if DEBUG
struct ContentView_Previews : PreviewProvider {
static var previews: some View {
ContentView()
}
}
#endif