moredip / PublicAutomation

Other
4 stars 22 forks source link

Tap not working on a UITableView #2

Closed drekka closed 11 years ago

drekka commented 11 years ago

HI again,

I've got taps working on buttons just fine. I then ran some test code that tapped a UITableView using

[UIAutomationBridge tapView:view]

where view is a reference to the UITableView.

So far, I've not been able to get this to work. The UITableView does not fire it's tableView:didSelectRowAtIndexPath: method.

I presume you have PA working against tables. I've looked at the Frank code, but didn't spot anything that would indicate a table related work-around.

any ideas?

drekka commented 11 years ago

Ok, I've found out some more. Tapping does not select the row. LongPressing does, providing it's at least 0.2 seconds long.

I've been trying to figure this out and I think it's something to do with the setup of the table. But so far I cannot figure out what. I've also noticed the same behaviour in GHUnit's app test runner. If I run it in the simulator and quickly click a row, it is not selected. If I click and hold for about half a second then the row is selected.

This seems to run contra to the doco on UITableViews which talks about taps.

Do you have any idea what is doing this?

drekka commented 11 years ago

Cracked it. The cause was that the table view had delaysContentTouches turned on. SO I'm thinking I'll have to do a little detective work and check for this before sending taps to anything scrollable.