ListView for Xamarin.iOS: Cell Swipe Gesture
The swipe gesture feature allows end-users to use swipe the ListView cell. When the user swipes, the content view moves revealing a designated swipe background view where you can place custom views ready for interaction e.g. buttons images etc.
Enable Cell Swipe Gesture
Use the AllowsCellSwipe
property to allow the user to perform swipe gesture on cells.
Configure Cell Swipe Gesture
Use the CellSwipeLimits
property to set how far the cell may be swiped.
Use the CellSwipeTreshold
property to set the minimum distance the user needs to swipe before the gesture is considered effective. If the user swipes below the treshold, the cell will auto-revert to its original state.
Use the CellSwipeAnimationDuration
property to set the cell swipe animation duration
Add the content that should be visible when swipe is applied to the backgroundView of TKListViewCell:
Responding to swipe interactions
In order to respond programmatically to a swipe gesture performed by user, you will need to implement one or more of the following methods from the TKListViewDelegate protocol.
ShouldSwipeCell
DidSwipeCell
DidFinishSwipeCell
A sample ListView Cell Swipe example can be found in our Native Xamarin.iOS examples.