Skip to content

Commit b9599b4

Browse files
committed
fix tappedButtonAtIndex called multiple times
as describe @ MortimerGoro#77
1 parent eb803c9 commit b9599b4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

MGSwipeTableCell/MGSwipeTableCell.m

+1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ -(instancetype) initWithButtons:(NSArray*) buttonsArray direction:(MGSwipeDirect
8787
_buttons = _fromLeft ? buttonsArray: [[buttonsArray reverseObjectEnumerator] allObjects];
8888
for (UIView * button in _buttons) {
8989
if ([button isKindOfClass:[UIButton class]]) {
90+
[(UIButton *)button removeTarget:nil action:NULL forControlEvents:UIControlEventAllEvents];
9091
[(UIButton *)button addTarget:self action:@selector(buttonClicked:) forControlEvents:UIControlEventTouchUpInside];
9192
}
9293
if (!differentWidth) {

0 commit comments

Comments
 (0)