Using gestures is simple and divided into two steps:
- Creates a gesture instance. When creating gestures, specify a callback method that is called when the gesture starts, changes, or ends.
- Added to the view that needs to be recognized. Each gesture corresponds to only one view, and when the screen touches within the bounds of the view, if the gesture is the same as the reservation, the callback method is used.
(iv), panning gestures
(v), pinch gestures
(vi), swipe gesture
To change a picture on a view by swiping gestures
(vii), screen edge swipe gesture
Changing the background color of a view with a screen swipe gesture
(eight), simultaneous triggering of two view gesturesThe gesture is mutually exclusive, and if you want to trigger the snake and Dragon view at the same time, you need to implement the Protocol
Uigesturerecognizerdelegate,
and returns Yes in the Protocol method.
Set self as proxy to gesture
iOS seven gestures (pan, pinch, swipe, screen edge swipe) gesture Recognizer method