alikaragoz / MCSwipeTableViewCell

:point_up_2: Convenient UITableViewCell subclass that implements a swippable content to trigger actions (similar to the Mailbox app).
MIT License
2.96k stars 412 forks source link

Configuring all the actions in one direction #77

Closed carlodurso closed 10 years ago

carlodurso commented 10 years ago

First of all congratulations for building this library.

I'm actually trying to configure four actions on the left to right slide action.

While I'd like to request your assistance to point out where I can make adjustments for this to happen, I was considering that it may be nice to have this kind of flexibility available in the library.

alikaragoz commented 10 years ago

Hello @carlodurso thank you for your kind words :blush: In order to make the necessary adjustment you will need to refactor a good part of the code but the important methods for you are the ones which contain the *WithPercentage string in their name. Good luck!

carlodurso commented 10 years ago

Thanks for the swift response @alikaragoz.

Actually, it was easier than I thought to refactor the code. I'll leave my findings here for future references.

In order to move actions on a different side I had to look for _modeForState3 and _modeForState4, changing the operator for the following methods:

- (UIView *)viewWithPercentage:(CGFloat)percentage; - (UIColor *)colorWithPercentage:(CGFloat)percentage; - (MCSwipeTableViewCellState)stateWithPercentage:(CGFloat)percentage;

Thanks again for making this library available to everyone, and by enhancing your code with educational comments.

alikaragoz commented 10 years ago

Ah, it was quick! Good job @carlodurso :+1: