2

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.

eli-bd
  • 1,533
  • 2
  • 17
  • 35
yo2bh
  • 1,356
  • 1
  • 14
  • 26

1 Answers1

0

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.

NSRover
  • 932
  • 1
  • 12
  • 29