Skip to content

Commit

Permalink
[Issue MortimerGoro#337] Handle swipe with accessory in storyboard mo…
Browse files Browse the repository at this point in the history
…de on iOS13
  • Loading branch information
yambaypaul committed Sep 26, 2019
1 parent d7c4e09 commit aae5eab
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions MGSwipeTableCell/MGSwipeTableCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,7 @@ @implementation MGSwipeTableCell
bool _overlayEnabled;
UITableViewCellSelectionStyle _previusSelectionStyle;
NSMutableSet * _previusHiddenViews;
UITableViewCellAccessoryType _previusAccessoryType;
BOOL _triggerStateChanges;

MGSwipeAnimationData * _animationData;
Expand Down Expand Up @@ -1037,6 +1038,19 @@ - (UIImage *)imageFromView:(UIView *)view cropSize:(CGSize)cropSize{

-(void) setAccesoryViewsHidden: (BOOL) hidden
{
if (@available(iOS 13, *)) {
// Hide the accessory to prevent blank box being displayed in iOS13-beta
// (blank area would be overlayed in accessory area when using cell in storyboard view)
// This may be fixed in iOS13 production release
if (hidden) {
_previusAccessoryType = self.accessoryType;
self.accessoryType = UITableViewCellAccessoryNone;
} else if (self.accessoryType == UITableViewCellAccessoryNone) {
self.accessoryType = _previusAccessoryType;
_previusAccessoryType = UITableViewCellAccessoryNone;
}
}

if (self.accessoryView) {
self.accessoryView.hidden = hidden;
}
Expand Down

0 comments on commit aae5eab

Please sign in to comment.