Note: This is the iOS 13 beta, but also could apply to the official release tomorrow.
Update 2: I replaced it with a larger thumb
SWIFT 5
The Problem can be solve using delegate method of gesturerecognizer as below
func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive touch: UITouch) -> Bool {
if touch.view?.isKind(of: UISlider.self) ?? false {
return false
} else {
return true
}
}
What I did was use a gestureRecognizer function to stop any gestures if a touch was detected on my UISliders. Make sure to add UIGestureRecognizerDelegate and set the UISwipeGestureRecognizer's delegate to self.
func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive touch: UITouch) -> Bool {
if touch.view == self.view.viewWithTag(viewTags.MySlider.rawValue) {
return false
}
else if touch.view == self.view.viewWithTag(viewTags.AnotherSlider.rawValue) {
return false
}
return true
}
I tried to find something during the last hour. It looks like the swipe gesture recognizer as interferance with UISlider.
The problem appears only if you are using right/left direction. Perhaps you should wait before update your app or change your UI to use the up/down swipe gesture.
At this time the slider works normally if you wait a bit before you move your finger. Hoping Apple will fix it quickly.
I had the same issue and managed to resolve it by doing the following:
Add a panGesture ,that does nothing, to your sliders and set their cancelsTouchesInView propery to false.
let panGesture = UIPanGestureRecognizer(target: nil, action:nil)
panGesture.cancelsTouchesInView = false
slider.addGestureRecognizer(panGesture)
Now your sliders should slide like a knife cutting a butter with no swipe interruption.