Performing simulations in the UI elements in uikit

I wanted to perform simulation in my application as a self tour guide for my user. For this I want to programatically simulate various user interaction events like button click, keypress event in the UITextField or moving the cursor around in the textField. These are only few examples to state, it can be any user interaction event or other events.

I wanted to know what is the apple recommendation on how should these simulations be performed? Is there something that apple offers like creating an event which can be directly executed for simulations. Is there some library available for this purpose?

There may be another way, if the script of the guided tour is fixed.

You could run it yourself and record the session. https://support.apple.com/en-us/102618

Then you could edit it to add any caption, voice, skip some parts…

In AppKit (macOS), you can simulate events(like key press) programmatically using NSEvent and CGEvent APIs. I wanted to know is there something similar to this in uikit?

There is XCTest framework available which helps in simulation , how does this internally perform the simulation? Can that not be used?

Performing simulations in the UI elements in uikit
 
 
Q