30

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];
RJFalconer
  • 10,890
  • 5
  • 51
  • 66
kennbrodhagen
  • 4,258
  • 2
  • 26
  • 21
  • any further findings on this? I encounter same issue here – air_bob Aug 01 '14 at 03:40
  • I explicitly called the touchesBegin, dragged and touchUp inside category function and it worked as I expected. May be a pull request might solve this. Will stress test my implementation. Please watch my fork for more update on this, https://github.com/krutarth/KIF – TeaCupApp Sep 03 '14 at 05:05
  • i have similar kind of situation, in my case there is another view in the view hierarchy with tap gesture which is interfacing the touchesEnded delegate method – Hashim MH Aug 30 '15 at 06:42
  • this is several years too late most likely, but is the `coinTarget` point still within the bounds of the `view`? Perhaps that view isn't get a `touchesEnded` callback since the touch is ending outside it's view bounds? – BHendricks Apr 12 '18 at 14:36

0 Answers0