Detecting when finished moving crosshair?


Hello !

I am trying to hide the crosshair as soon as the touch is ended but I can’t seem to find a good hook for this.

Anybody knows how to achieve this ?

Thanks you !


Hi Yannick,

Thanks for getting in touch!

There currently don’t support this feature straight out the box.

However, it is possible by adding your own target and selector to our long press gesture on your chart’s gestureManager property like so:

[_chart.gestureManager.longPressGesture addTarget:self action:@selector(fire)];

Then implement a method to check the state of the long press gesture like so:

-(void)fire {
    switch (_chart.gestureManager.longPressGesture.state) {
        case UIGestureRecognizerStateEnded:
            [_chart.crosshair hide];

Let me know if you have any questions.

Kind regards,
Andrew Polkinghorn.

SChartDelegate zooming support not there anymore?

Thanks a lot, it works like a charm !

Big thumbs up for the support !