Charts: 3.5.0 from 3.4.0 introduced a regression in pan handling

Created on 8 Aug 2020  ·  3Comments  ·  Source: danielgindi/Charts

First of, thanks for an AWESOME library 🚀

chartViewDidEndPanning is not being called in 3.5.0 after this change:

https://github.com/danielgindi/Charts/pull/4271

if anyone is interested, I am using this fork for now: https://github.com/GetBlast/Charts/commit/22e8eca5af55e11c41644a498bc941dd859c2680 from @tsorencraig

Most helpful comment

Yes, a new delegate method, please!
Not nice but this "workaround" helped me:

let pan = lineChartView.gestureRecognizers?.first { $0 is UIPanGestureRecognizer } pan?.addTarget(self, action: #selector(gestureRecognized(_:)))

@objc func gestureRecognized(_ recognizer: UIPanGestureRecognizer) { if recognizer.state == .ended || recognizer.state == .cancelled { // Pan Ended } }

All 3 comments

Having the same issue with LineChartView's delegate (chartViewDidEndPanning not getting called).

Would be nice to have a new delegate method to handle when highlight drag has ended or maybe add a new parameter to the existing chartViewDidEndPanning to differentiate which panning action happened.

Yes, a new delegate method, please!
Not nice but this "workaround" helped me:

let pan = lineChartView.gestureRecognizers?.first { $0 is UIPanGestureRecognizer } pan?.addTarget(self, action: #selector(gestureRecognized(_:)))

@objc func gestureRecognized(_ recognizer: UIPanGestureRecognizer) { if recognizer.state == .ended || recognizer.state == .cancelled { // Pan Ended } }

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kwstasna picture kwstasna  ·  3Comments

cilasgimenez picture cilasgimenez  ·  4Comments

anhltse03448 picture anhltse03448  ·  3Comments

BrandonShega picture BrandonShega  ·  4Comments

valeIT picture valeIT  ·  3Comments