0

I have a UISlider inside of my view, the view itself have a swipeGesture added to it. So that when the user swipe in the right hand-side direction, the viewController will go back to the previous one. However, my issue here is that if the UISlider nob is moved in the right hand-side direction, it gets confused with a swipeGesture and the view navigates to the previous one.

Is there a way to disable the detection of swipeGesture for the UISlider element on its own?

devJo
  • 63
  • 7

1 Answers1

0

I found the answer to my above question in one of the posts on this website, however, I cannot find the link again for it.

Basically, I added a panGesture to the UIScrollView element, and set its cancelsTouchesInView property to false as demonstrated below:

let panGestureRecogniseForDepthOfSectionUISlider = UIPanGestureRecognizer(target: nil, action:nil)

panGestureRecogniseForDepthOfSectionUISlider.cancelsTouchesInView = false
devJo
  • 63
  • 7
  • https://stackoverflow.com/questions/58001780/swipe-gesture-interrupts-uislider-control-in-ios-13-but-not-previous-ios-versio/64925705#64925705 You can check here. – kalpa Nov 20 '20 at 07:55