Simulate touch on iphone

后端 未结 5 950
清酒与你
清酒与你 2020-12-05 01:29

Im trying to simulate a touch on as UIWebView, how can I programmatically fire a touch event at a certain location? (x and y coordinates) Just call touchesBegan?

Ide

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-05 02:00

    It's worth pointing out the KIF framework here. It's intended to run in the simulator but part of the code is simulating touch evens in code. with luck, this will be a good starting point.

    https://github.com/square/KIF

    Specifically, look at stepToTapViewWithAccessibilityLabel in KIFTestStep.m and the line

    [view tapAtPoint:tappablePointInElement];
    

提交回复
热议问题