The events managed by iOS during user interaction are grouped into three main sets:
Even if these events are extremely different, they can be encapsulated and handled by the same class: UIEvent
. An event instance can be easily distinguished by checking its type
property, a UIEventType
enum, with the following declaration:
enum UIEventType : Int { case Touches case Motion case RemoteControl }
When users interact with the screen, a multitouch sequence is generated. Each step of a sequence is described by the same UIEvent
instance that carries a set of UITouch
objects: one per each of the user's fingers taking part in the multitouch sequence.
The event instance remains the same for the whole sequence, and the same is true for the touch instances that are updated during the sequence, preventing...