I use in my app library SwiftChart and I want to create such view of chart:
My code:
class MyViewController: UIViewController, ChartDelegate {
override func viewDidLoad() {
lineChart.delegate = self
}
// Chart delegate
func didTouchChart(_ chart: Chart, indexes: Array<Int?>, x: Double, left: CGFloat) {
// Do something on touch
}
func didFinishTouchingChart(_ chart: Chart) {
// Do something when finished
}
func didEndTouchingChart(_ chart: Chart) {
// Do something when ending touching chart
}
func didTouchChart(chart: Chart, indexes: Array<Int?>, x: Double, left: CGFloat) {
for (seriesIndex, dataIndex) in enumerate(indexes) {
if dataIndex != nil {
// The series at `seriesIndex` is that which has been touched
let value = chart.valueForSeries(seriesIndex, atIndex: dataIndex)
}
}
}
But I received and error message:
Use of unresolved identifier 'enumerate'
What's wrong?