I'm trying to draw a line chart in Swift UI but can't implement the for loop:
Path { path in
path.move(to: CGPoint(x: 20, y: 20))
ForEach(0 ..< 11) { index in
path.addLine(to: CGPoint(x: ((index * 20) + 40), y: Int(hr[index])))
}
Gives me a build error:
Type '()' cannot conform to 'View'; only struct/enum/class types can conform to protocols