I wanted to use the GeometryReader to use some computation. Without my design looks like it should:
var body: some View {
ZStack {
Color(#colorLiteral(red: 0.117543973, green: 0.2897527516, blue: 0.4028342962, alpha: 1)).edgesIgnoringSafeArea(.all)
VStack {
HStack(spacing: self.spacing) { // todo auch berechnen?
ForEach(self.chartValues, id: \.self) { point in
DataPoint(width: 200)
}
}.animation(.default)
}
}
}
After adding it, each line is overlapping each other in its height, did I something wrong:
var body: some View {
ZStack {
Color(#colorLiteral(red: 0.117543973, green: 0.2897527516, blue: 0.4028342962, alpha: 1)).edgesIgnoringSafeArea(.all)
VStack {
GeometryReader { geo in
HStack(spacing: self.spacing) { // todo auch berechnen?
ForEach(self.chartValues, id: \.self) { point in
DataPoint(width: geo.size.width)
}
}.animation(.default)
}
}
}
}