From 6a9546bb1fc211ee4cf05cbb488bfec9a29aecd6 Mon Sep 17 00:00:00 2001 From: Fredrik Lillejordet Date: Tue, 3 Mar 2020 12:45:45 +0100 Subject: [PATCH] added id: self in ForEach for dynamic content in BarChartRow (#49) Co-authored-by: Andras Samu --- Sources/SwiftUICharts/BarChart/BarChartRow.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/SwiftUICharts/BarChart/BarChartRow.swift b/Sources/SwiftUICharts/BarChart/BarChartRow.swift index f43e14d..fb5308d 100644 --- a/Sources/SwiftUICharts/BarChart/BarChartRow.swift +++ b/Sources/SwiftUICharts/BarChart/BarChartRow.swift @@ -19,7 +19,7 @@ public struct BarChartRow : View { public var body: some View { GeometryReader { geometry in HStack(alignment: .bottom, spacing: (geometry.frame(in: .local).width-22)/CGFloat(self.data.count * 3)){ - ForEach(0.. CGFloat(i)/CGFloat(self.data.count) && self.touchLocation < CGFloat(i+1)/CGFloat(self.data.count) ? CGSize(width: 1.4, height: 1.1) : CGSize(width: 1, height: 1), anchor: .bottom) .animation(.spring())