MGSwipeTableCell
MGSwipeTableCell copied to clipboard
Make portion of cell swipeable
Is there a way to make a portion of the cell swipeable, and the rest static?
You can do something like this:
- Add your static view to cell.swipeContentView instead of cell.contentView
- Override swipeOffset in your MGSwipeTableCell subclass and layout the static view based on the offset value to simulate a fixed position. Code example (not tested):
- (void)setSwipeOffset:(CGFloat) newOffset
{
[super setSwipeOffset:newOffset];
//layout the static view to simulate a fixed position
UIView * staticView; //Use your view here
CGRect frame = staticView.frame;
frame.origin.x = -newOffset;
staticView.frame = frame;
}