Skip to content

Commit c238204

Browse files
jballerfacebook-github-bot
authored andcommitted
Taplog: print the touch's UIGestureRecognizers
Summary: I think more information here will make everyone's lives easier while debugging! It's common for gesture recognizers to preempt or otherwise interfere with a hit-testing view's touch handling: - A UIScrollView can delay touches began (and does so with a private GR) - A Tap GR on the target view or its superview can handle a touch and prevent touchesBegain from ever getting called on the hit-testing view (e.g. before the `delaysTouchesBegain` delay expires) - A hit-testing UIButton (and only a UIButton) can cause a tap gesture recognizer to fail etc. Maybe we can also follow up with a mechanism for breaking when a given GR's state changes. But in the meantime it'd at least be helpful to add a watch expression and inspect a given GR manually. Reviewed By: samishchandra Differential Revision: D20908394 fbshipit-source-id: 89d075cc4073573013ef5fe41ebcaa026a77e2e5
1 parent 22e0571 commit c238204

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

commands/FBFindCommands.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,11 @@ def run(self, arguments, options):
120120
@staticmethod
121121
def taplog_callback(frame, bp_loc, internal_dict):
122122
parameterExpr = objc.functionPreambleExpressionForObjectParameterAtIndex(0)
123-
print(fb.describeObject('[[[%s allTouches] anyObject] view]' % (parameterExpr)))
123+
print('Gesture Recognizers:\n{}'.format(fb.describeObject(
124+
'[[[%s allTouches] anyObject] gestureRecognizers]' % (parameterExpr)
125+
)))
126+
print('View:\n{}'.format(fb.describeObject(
127+
'[[[%s allTouches] anyObject] view]' % (parameterExpr)
128+
)))
124129
# We don't want to proceed event (click on button for example), so we just skip it
125130
lldb.debugger.HandleCommand('thread return')

0 commit comments

Comments
 (0)