How to synthesize / stimulate a touch event on an iOS device quickly?

In my app, I need to stimulate touch for my app on device. Does anyone know how to simulate touching a device using UITouch and UIEvent in swift?

Thanks in advance.

+3


source to share


1 answer


It is wrong and impossible to simulate user actions programmatically. The UITouch and UIEvent APIs are designed to get touch event data from the user so as not to create your own. I suggest you go back to your use case.



If you want to do this as part of your UI testing, take a look at XCUITests.

0


source







All Articles