2

We are unable to successfully tap any of our subclassed UIView's that have UITapGestureRecognizers on them. We know that the UIViews have correct AccessibilityLabels on them, as when we run the tests the tests do not fail to recognize the Views, we see the tap occurring over the area of the View, AND we're able to record our actions manually and it fills it out just as we'd typed out our tests. Sadly, none of the taps actually register on our View and our tests end up doing nothing.

Buttons, ButtonSelects etc all work just fine.

Is there something we're missing here? Any help would be greatly appreciated.

Thanks.

Bay Phillips
  • 2,015
  • 1
  • 13
  • 7
  • Post some of your code. Did you add the gesture recognizer to the view? Did you set its delegate? Is `userInteractionEnabled` set to `YES`? Is the UIView covered by another UIView, or displayed outside the bounds of its superview? There are lots of potential causes; we need more information to help. – Aaron Brager Apr 25 '13 at 16:07
  • I know the code works fine as the app works correctly in both the simulator and on devices. The tapping not registering is only when running through the MonkeyTalk IDE. That said, I'd also posted this on the MonkeyTalk forums and it appears that it may actually be a bug: https://www.gorillalogic.com/content/cannot-tap-subclassed-uiview-ios#comment-6085 – Bay Phillips Apr 25 '13 at 17:27

1 Answers1

0

By analyzing MonkeyTalk source code I discovered that your custom view with gesture recognizers must be the first view to receive touch. Meaning all its subviews must have userInteractionEnabled set to NO. After I made this change it worked for me.

kolyuchiy
  • 5,465
  • 2
  • 23
  • 31