更新时间:2023-02-12 22:20:29
您可以将 UIPanGestureRecognizer
添加到滑块,并将 cancelsTouchesInView
属性设置为 false代码> 避免 UIPageViewController 在拖动滑块时滑动:
You can add an UIPanGestureRecognizer
to the slider with the cancelsTouchesInView
attribute to false
to avoid the UIPageViewController to swipe when you drag the slider :
let panGesture = UIPanGestureRecognizer()
panGesture.cancelsTouchesInView = false
yourSlider.addGestureRecognizer(panGesture)