Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't suspend the ongoing drag #3953

Closed
ionsilviumihai opened this issue Apr 18, 2019 · 1 comment
Closed

Can't suspend the ongoing drag #3953

ionsilviumihai opened this issue Apr 18, 2019 · 1 comment

Comments

@ionsilviumihai
Copy link

ionsilviumihai commented Apr 18, 2019

There is a case when the user is dragging the chart (on X-axis) using two fingers and I end up having a nasty UI bug.
I want to suspend all touch events on the chart at a certain point. I have an ongoing drag event on the chart that I can't force cancel.

I tried:

  • chartView.dragEnable = false
  • chartView.isUserInteractionEnabled = false
  • UIApplication.shared.endIgnoringInteractionEvents()

All these are disabling the interaction that starts in the future but is not invalidating the touch happening on the chart at the moment the instruction is called.

On Android, the trick is perfectly done by using chartView.setTouchEnabled(false), but the iOS Charts seems that is not supporting this.

How should I handle this?

Charts Environment

Charts version/Branch/Commit Number: Charts 3.1.1
Xcode version: 10.1
Swift version: 4.2
Platform(s) running Charts: iOS 12.1.4
macOS version running Xcode: 10.14

@liuxuan30
Copy link
Member

I want to suspend all touch events on the chart at a certain point. I have an ongoing drag event on the chart that I can't force cancel.

I assume you should check if you can invalidate the gesture itself, like checking the state and hijack something to stop it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants