diff --git a/MGSwipeTableCell/MGSwipeTableCell.h b/MGSwipeTableCell/MGSwipeTableCell.h index c91b006..d26369d 100644 --- a/MGSwipeTableCell/MGSwipeTableCell.h +++ b/MGSwipeTableCell/MGSwipeTableCell.h @@ -223,7 +223,14 @@ typedef NS_ENUM(NSInteger, MGSwipeEasingFunction) { /** optional to use contentView alternative. Use this property instead of contentView to support animated views while swiping */ @property (nonatomic, strong, readonly, nonnull) UIView * swipeContentView; -/** +/** + * Abacus property to allow grouped cells + * + */ +@property (nonatomic, assign) UIEdgeInsets contentInsets; +@property (nonatomic, assign) CGFloat cornerRadius; + +/** * Left and right swipe buttons and its settings. * Buttons can be any kind of UIView but it's recommended to use the convenience MGSwipeButton class */ diff --git a/MGSwipeTableCell/MGSwipeTableCell.m b/MGSwipeTableCell/MGSwipeTableCell.m index 7d054b9..66f08ab 100644 --- a/MGSwipeTableCell/MGSwipeTableCell.m +++ b/MGSwipeTableCell/MGSwipeTableCell.m @@ -813,19 +813,21 @@ -(void) createSwipeViewIfNeeded { UIEdgeInsets safeInsets = [self getSafeInsets]; if (!_swipeOverlay) { - _swipeOverlay = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.bounds.size.width, self.contentView.bounds.size.height)]; + _swipeOverlay = [[UIView alloc] initWithFrame:CGRectMake(self.contentInsets.left, 0, self.bounds.size.width-self.contentInsets.left - self.contentInsets.right, self.contentView.bounds.size.height)]; [self fixRegionAndAccesoryViews]; _swipeOverlay.hidden = YES; _swipeOverlay.backgroundColor = [self backgroundColorForSwipe]; _swipeOverlay.layer.zPosition = 10; //force render on top of the contentView; + [_swipeOverlay setAccessibilityLabel:@"Swipe Overlay"]; + _swipeOverlay.clipsToBounds = YES; + [self.contentView addSubview:_swipeOverlay]; _swipeView = [[UIImageView alloc] initWithFrame:_swipeOverlay.bounds]; _swipeView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; _swipeView.contentMode = UIViewContentModeCenter; - _swipeView.clipsToBounds = YES; + [_swipeView setAccessibilityLabel:@"Swipe View"]; [_swipeOverlay addSubview:_swipeView]; - [self.contentView addSubview:_swipeOverlay]; } - + [self fetchButtonsIfNeeded]; if (!_leftView && _leftButtons.count > 0) { _leftSwipeSettings.allowsButtonsWithDifferentWidth = _leftSwipeSettings.allowsButtonsWithDifferentWidth || _allowsButtonsWithDifferentWidth; @@ -849,7 +851,6 @@ -(void) createSwipeViewIfNeeded _rightView.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleHeight; [_swipeOverlay addSubview:_rightView]; } - // Refresh safeInsets if required if (_leftView) { [_leftView setSafeInset:safeInsets.left extendEdgeButton:_leftSwipeSettings.expandLastButtonBySafeAreaInsets isRTL: [self isRTLLocale]]; @@ -860,6 +861,9 @@ -(void) createSwipeViewIfNeeded } } +-(void) updateSwipeFrames { + +} - (void) showSwipeOverlayIfNeeded { @@ -922,7 +926,6 @@ -(void) hideSwipeOverlayIfNeededIncludingReselect: (BOOL) reselectCellIfNeeded [_tableInputOverlay removeFromSuperview]; _tableInputOverlay = nil; } - if (reselectCellIfNeeded) { self.selectionStyle = _previusSelectionStyle; NSArray * selectedRows = self.parentTable.indexPathsForSelectedRows;