Applying the gesturechange (pinch actions) event to a pie chart
So far, we have only explored actions involving a single touch point. Our next goal is to learn how to apply more advanced action events with multi-touch. One of the most common actions is the pinch-in/out for zooming out/in respectively. The Safari browser for iOS supports this motion with the gesturestart
, gesturechange
, and gestureend
events. Whenever there are two or more fingers touching the screen, the gesturestart
event is fired. Then, the gesturechange
event is triggered when the fingers are moved on the screen. When the fingers leave the screen, the gestureend
event is generated. In returning control to the event handler, if the action is recognized, a certain property in the event object is updated. For instance, the scale
property in the event object is set to larger than 1.0 for pinch-out and less than 1.0 for pinch-in. For the GestureEvent
class reference, please see https://developer.apple.com/library/mac/documentation...