摘要 |
PROBLEM TO BE SOLVED: To provide a comprehensive framework or mechanism for recognizing touch gestures and touch events, as well as gestures and events from other input sources.SOLUTION: A method comprises: displaying one or more views of a view hierarchy; executing software elements associated with particular views, each particular view including event recognizers, each event recognizer having one or more event definitions and an event handler that specifies an action for a target, and sending the action to the target in response to an event recognition; detecting a sequence of sub-events; identifying one of the views of the view hierarchy as a hit view that establishes which views are actively involved views; and delivering an individual sub-event to event recognizers for each of the views. Each gesture recognizer has a plurality of event definitions, one of which is selected in accordance with an internal state, and processes the individual sub-event prior to processing a next sub-event in the sequence of sub-events. |