Skip to content

Commit

Permalink
Merge pull request MortimerGoro#261 from dmsl1805/master
Browse files Browse the repository at this point in the history
MGSwipeExpansionLayoutNone added.
  • Loading branch information
MortimerGoro authored Mar 19, 2017
2 parents 2f03dde + 30c8e1c commit d93720b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion MGSwipeTableCell/MGSwipeTableCell.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ typedef NS_ENUM(NSInteger, MGSwipeState) {
/** Swipe state */
typedef NS_ENUM(NSInteger, MGSwipeExpansionLayout) {
MGSwipeExpansionLayoutBorder = 0,
MGSwipeExpansionLayoutCenter
MGSwipeExpansionLayoutCenter,
MGSwipeExpansionLayoutNone
};

/** Swipe Easing Function */
Expand Down
8 changes: 7 additions & 1 deletion MGSwipeTableCell/MGSwipeTableCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -204,16 +204,22 @@ -(void) expandToOffset:(CGFloat) offset settings:(MGSwipeExpansionSettings*) set
_expandedButton.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
[_expandedButton.superview bringSubviewToFront:_expandedButton];
_expandedButton.frame = _container.bounds;
_expansionBackground.frame = [self expansionBackgroundRect:_expandedButton];
}
else if (_expansionLayout == MGSwipeExpansionLayoutNone) {
[_expandedButton.superview bringSubviewToFront:_expandedButton];
_expansionBackground.frame = _container.bounds;
}
else if (_fromLeft) {
_expandedButton.frame = CGRectMake(_container.bounds.size.width - _expandedButton.bounds.size.width, 0, _expandedButton.bounds.size.width, _expandedButton.bounds.size.height);
_expandedButton.autoresizingMask|= UIViewAutoresizingFlexibleLeftMargin;
_expansionBackground.frame = [self expansionBackgroundRect:_expandedButton];
}
else {
_expandedButton.frame = CGRectMake(0, 0, _expandedButton.bounds.size.width, _expandedButton.bounds.size.height);
_expandedButton.autoresizingMask|= UIViewAutoresizingFlexibleRightMargin;
_expansionBackground.frame = [self expansionBackgroundRect:_expandedButton];
}
_expansionBackground.frame = [self expansionBackgroundRect:_expandedButton];

} completion:^(BOOL finished) {
}];
Expand Down

0 comments on commit d93720b

Please sign in to comment.