How to synthesise/ stimulate touch event on iOS device in swift?

629 Views Asked by At

In my app, i need to stimulate touch for my app on device. Does anyone know how to simulate touch on device using UITouch & UIEvent in swift?

Thanks in advance.

1

There are 1 best solutions below

0
On

It is wrong and impossible to simulate user actions programatically. UITouch & UIEvent APIs are meant to get data about touch event from user not to create your own. I suggest you to revisit your use case.

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