From cf40cdd5caaf84adaa798898c6bf6c581f5ea169 Mon Sep 17 00:00:00 2001 From: = Date: Thu, 20 Jul 2017 12:37:49 -0700 Subject: [PATCH] Fix crash upon rotation while buttons are displayed --- MGSwipeTableCell/MGSwipeTableCell.m | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/MGSwipeTableCell/MGSwipeTableCell.m b/MGSwipeTableCell/MGSwipeTableCell.m index 267f14b..7248c38 100644 --- a/MGSwipeTableCell/MGSwipeTableCell.m +++ b/MGSwipeTableCell/MGSwipeTableCell.m @@ -831,9 +831,12 @@ -(void) refreshContentView CGFloat currentOffset = _swipeOffset; BOOL prevValue = _triggerStateChanges; _triggerStateChanges = NO; - self.swipeOffset = 0; - self.swipeOffset = currentOffset; - _triggerStateChanges = prevValue; + __block MGSwipeTableCell *blockSelf = self; + [self setSwipeOffset:0 animated:NO completion:^{ + [blockSelf setSwipeOffset:currentOffset animated:NO completion:^{ + _triggerStateChanges = prevValue; + }]; + }]; } -(void) refreshButtons: (BOOL) usingDelegate