MCSwipeTableViewCell
MCSwipeTableViewCell copied to clipboard
Allow different behavior for directions, and hold after completion
The best way to demonstrate the point of these changes is to illustrate the final behavior:
Allow different behavior for left or right swipe
- Added
thirdTrigger
andfourthTrigger
to allow different trigger point for right to left swiping (6a08db253b59272538f8d7f74e397af6c26ded72). If unset, will just usefirstTrigger
andsecondTrigger
, respectively (cae4f3e44d62dd8a6b7b152f3ef0ca7abdc8d941) - Added
rightDefaultColor
to set a differentdefaultColor
for the start of a right to left swipe. By default it will just usedefaultColor
(e35fc13d1390ded7d5cc70cd4db8009f54a659e3, fee9a6161eb27670ac5965a59483e966425ed811)
Allow swipe cell to completion, but then continue to allow interaction
- I wanted to be able to use MCSwipeTableViewCell to add a layer of interaction "below" the cell (either for editing functions, or additional detail).
-
MCSwipeTableViewCellModeExit
no longer allow interaction with the cell or to swipe it back to the origin -
MCSwipeTableViewCellModeSwitch
obviously won't swipe to completion - Added a new mode
MCSwipeTableViewCellModeHold
to enable this behavior (see the gif above)
Add additional delegate callback that includes the state at the time of completion
- Seems like a useful argument to add to the callback method. Don't want to break existing code, so added it as an extra method
Note about animation
- The gif above also includes changes to the animations. Those aren't generic and are not included in a pull request. If you use only an icon, everything would work fine. If you use a full width uiview, then the animation is wrong.
- If you want to accept this pull request, and I figure out a way to make the changes generic I'll follow up with another pull request