A swipe gesture takes place when a hand is moved over the display screen in a horizontal or vertical way, and is also typically accustomed start navigation through content.

A swipe gesture takes place when a hand is moved over the display screen in a horizontal or vertical way, and is also typically accustomed start navigation through content.

The signal examples in this essay were obtained from the Swipe Gesture sample.

To manufacture a see know a swipe gesture, produce a SwipeGestureRecognizer case, put the Direction house to a SwipeDirection enumeration importance ( leftover , Right , right up , or Down ), optionally ready the limit home, handle the Swiped show, and add the motion recognizer with the GestureRecognizers range about view. The subsequent code example demonstrates a SwipeGestureRecognizer mounted on a BoxView :

Here’s the similar C# code:

The SwipeGestureRecognizer class also incorporates a limit belongings, which can be optionally set to a uint value that presents the minimum swipe distance that really must be obtained for a swipe becoming known, in device-independent devices. The standard property value this house are 100, which means any swipes which can be under 100 device-independent models will be ignored.

Recognizing the swipe course

Within the examples above, the path property is placed to single an advantages from the SwipeDirection enumeration. Butis also feasible to set this house to several values from the SwipeDirection enumeration, in order that the Swiped occasion is fired in response to a swipe in more than one course. But the restriction would be that one SwipeGestureRecognizer can only identify swipes that take place on a single axis.