How does UIEvent happen?

Broadly speaking, what is the sequence of events that happens from the moment UIEvent is created, particularly the UITouch-related event? I'm getting conflicting information from various places.

One article is saying:
  1. UITouch/UIEvent is created

  2. UIApplication.shared.sendEvent() sends the event to a queue

  3. The event goes directly to the view's UIGestureRecognizer or UIResponder

It doesn't mention when the hit-tests from UIWindow all the way up to the touched view happens.

Second article says:
  1. An event is created

  2. The hit-test is performed on the view that was touched

  3. UIApplication.shared.sendEvent(_:)

  4. UIWindow.sendEvent(_:)

  5. UIGestureRecognizer

  6. Hit-test happens again?

  7. UIResponder

Another article says:
  1. An event is created

  2. UIApplication manages the queue of UIEvents

  3. UIWindow performs the hit test. I'm guessing this is done by UIWindow.sendEvent(_:)?

  4. UIApplication.shared.sendEvent(_:) sends the event to the first responder

  5. The event is handled by the gesture recognizer or the responder

Finally, another book I'm reading is saying:
  1. An event is created

  2. The event is handed to an instance of UIApplication through UIApplication.shared.sendEvent(_:)

  3. UIWindow gets the event through UIWindow.sendEvent(_:)

  4. UIWindow performs the hit-tests on the view hierarchy as well as the UIResponder

I'm ok with some of these resources having incomplete information. What frustrates me is how some of them have completely different orders. So far, I'm certain that an instance of UIEvent and UITouch are created first and UIGestureRecognizer and UIResponder are reached last, but that's about it.

What I'm confused about is:
  1. When do the hit-tests of the view hierarchy happen?

  2. What exactly does UIApplication.shared.sendEvent(_:) do? The definition says "Dispatches an event to the appropriate responder objects in the app", but this means that the UIEvent has to already know the touched view associated with it, which means this method has to be invoked after the hit-tests. But, none of the above resources say that UIApplication.shared.sendEvent(_:) happens AFTER the hit-tests.

  3. The definition of UIWindow.sendEvent(_:) says that it's for dispatching the event to a view (and not a responder like UIApplication.shared.sendEvent(_:)). I'm not exactly sure what the difference is. And does this happen before or after the hit-tests?

  4. What is this "queue" they keep referring to? Is it the queue to be sent to the instance of UIApplication or the responders or to UIWindow or to perform hit-tests?

P.S. for some reason I'm unable to post any of the links to the articles and am getting "This URL can't be included in your post. Please remove it to continue".
How does UIEvent happen?
 
 
Q