为什么 KIF UIView:dragFromPoint:toPoint 不会导致在我的视图上调用touchesEnded:withEvent?
这个问题是关于iOS验收测试框架KIF的。
我有一个测试步骤,它使用 UIView DragFromPoint:toPoint
的 KIF 扩展。我有一个自定义视图类,它实现了 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];
This question is about the iOS acceptance testing framework KIF.
I have a test step which uses the KIF extension to UIView dragFromPoint:toPoint
. I have a custom view class which implements touchesBegan
/touchesMoved
/touchesEnded
/touchesCancelled
.
From my KIF test step I convert my coordinates to that of my custom view and call dragFromPoint
. NSLog
& breakpoints tell me that touchesBegan
and touchesMoved
are being called on my view but touchesEnded
is not. Looking at the KIF code I can see that it's posting this event but I can't figure out why it's not being delivered to my view when the other two are.
Here is an excerpt of my KIF test step code:
// 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];
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论