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

时间:2011-09-25 21:08:06

标签: ios acceptance-testing kif-framework

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

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

在我的KIF测试步骤中,我将坐标转换为自定义视图的坐标并调用dragFromPointNSLog&断点告诉我,touchesBegantouchesMoved在我的视图中被调用,但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];

0 个答案:

没有答案