Edison-Hsu/100-days-of-RxSwift

UILongPressGestureRecognizer 只能在长按且移动的时候起作用

openlabb opened this issue · 1 comments

02-TapOrHoldCounter这个项目里

模拟器rxswift是2.3.1

longPressGesture.rx_event的事件只在长按且滑动的时候响应是为什么呢

这里longPressGesture用的就是UIKit自带的UILongPressGestureRecognizer
我自己测试这个事件在模拟器里的确是的确长按没有作用,但是在真机上测试长按是有效的。
根据下面摘自苹果的官方文档移动是会触发状态的改变。这个效果在真机和模拟器里都是一样的。
我真机版本是10.01,模拟器也是10.01

Long-press gestures are continuous. The gesture begins (began) when the number of allowable fingers (numberOfTouchesRequired) have been pressed for the specified period (minimumPressDuration) and the touches do not move beyond the allowable range of movement (allowableMovement). The gesture recognizer transitions to the Change state whenever a finger moves, and it ends (ended) when any of the fingers are lifted.