为什么KIF UIView:dragFromPoint:toPoint不会导致touchesEnded:在我的视图中调用withEvent?

ken*_*gen 17 acceptance-testing ios kif-framework

这个问题是关于iOS验收测试框架KIF.

我有一个使用KIF扩展的测试步骤UIView dragFromPoint:toPoint.我有一个实现touchesBegan/ touchesMoved/ touchesEnded/ 的自定义视图类touchesCancelled.

从我的KIF测试步骤,我将我的坐标转换为我的自定义视图并调用dragFromPoint. NSLog&断点告诉我,touchesBegan并且touchesMoved我的观点被调用但touchesEnded不是.看看KIF代码,我可以看到它正在发布这个事件,但我无法弄清楚为什么当其他两个都没有传递到我的视图时.

以下是我的KIF测试步骤代码的摘录:

// Convert points to coordinate system of the CoinView
CGPoint coinCenter = [view convertPoint:view.center fromView:view.superview];
CGPoint coinTarget = [view convertPoint:coinSlotTarget fromView:coinSlotView.superview];
[view dragFromPoint:coinCenter toPoint:coinTarget];
Run Code Online (Sandbox Code Playgroud)