Skip to content

Commit

Permalink
Merge pull request #339 from yambaypaul/master
Browse files Browse the repository at this point in the history
[Issue #337] Handle swipe with accessory in storyboard mode on iOS13
MortimerGoro authored Oct 16, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents d7c4e09 + aae5eab commit 08552ea
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
@@ -622,6 +622,7 @@ @implementation MGSwipeTableCell
bool _overlayEnabled;
UITableViewCellSelectionStyle _previusSelectionStyle;
NSMutableSet * _previusHiddenViews;
UITableViewCellAccessoryType _previusAccessoryType;
BOOL _triggerStateChanges;

MGSwipeAnimationData * _animationData;
@@ -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;
}

0 comments on commit 08552ea

Please sign in to comment.