MCSwipeTableViewCell icon indicating copy to clipboard operation
MCSwipeTableViewCell copied to clipboard

Allow different behavior for directions, and hold after completion

Open gtg922r opened this issue 11 years ago • 0 comments

The best way to demonstrate the point of these changes is to illustrate the final behavior: swipechanges2

Allow different behavior for left or right swipe

  • Added thirdTrigger and fourthTrigger to allow different trigger point for right to left swiping (6a08db253b59272538f8d7f74e397af6c26ded72). If unset, will just use firstTrigger and secondTrigger, respectively (cae4f3e44d62dd8a6b7b152f3ef0ca7abdc8d941)
  • Added rightDefaultColor to set a different defaultColor for the start of a right to left swipe. By default it will just use defaultColor (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

gtg922r avatar Feb 03 '14 08:02 gtg922r