Hello I am trying to create a graph screen similar to the IOS-Stocks application which is long-press tracking and touch scroll options. I am using Highcharts framework. Changing longPressView.options.tooltip.followTouchMove = true makes the graph trackable. And longPressView.options.tooltip.followTouchMove = false makes the graph scrollable.
let longPressRecognizer = UILongPressGestureRecognizer(target: self, action: #selector(longPressedTest))
longPressRecognizer.allowableMovement = 50
view.addGestureRecognizer(longPressRecognizer)
@objc func longPressedTest(sender: UILongPressGestureRecognizer) {
let longPressView = sender.view as! HIChartView
switch (sender.state) {
case UILongPressGestureRecognizer.State.began:
longPressView.options.tooltip.followTouchMove = true
print("longpress began")
case .ended:
longPressView.options.tooltip.followTouchMove = false
print("longpress ended")
case .cancelled:
longPressView.options.tooltip.followTouchMove = false
print("longpress cancelled")
case .failed:
longPressView.options.tooltip.followTouchMove = false
print("longpress ended")
case .possible:
longPressView.options.tooltip.followTouchMove = true
print("longpress possible")
case .changed:
longPressView.options.tooltip.followTouchMove = true
print("longpress changed")
@unknown default:
longPressView.options.tooltip.followTouchMove = false
print("longpress default")
}
}
Am I using the UILongPressGesture wrong?