public void setSwipeGestureWithView( UIView view, UIColor color, SwipeTableCellMode mode, SwipeTableViewCellState state, SwipeCompletionBlock completionBlock) { if (view == null || color == null) { return; } // Depending on the state we assign the attributes if ((state & SwipeTableViewCellState.StateRightShort) == SwipeTableViewCellState.StateRightShort) { CompletionBlockRightShort = completionBlock; ViewRightShort = view; ColorRightShort = color; ModeForStateRightShort = mode; } if ((state & SwipeTableViewCellState.StateRightLong) == SwipeTableViewCellState.StateRightLong) { CompletionBlockRightLong = completionBlock; ViewRightLong = view; ColorRightLong = color; ModeForStateRightLong = mode; } if ((state & SwipeTableViewCellState.StateLeftShort) == SwipeTableViewCellState.StateLeftShort) { CompletionBlockLeftShort = completionBlock; ViewLeftShort = view; ColorLeftShort = color; ModeForStateLeftShort = mode; } if ((state & SwipeTableViewCellState.StateLeftLong) == SwipeTableViewCellState.StateLeftLong) { CompletionBlockLeftLong = completionBlock; ViewLeftLong = view; ColorLeftLong = color; ModeForStateLeftLong = mode; } }
void executeCompletionBlock() { SwipeTableViewCellState state = stateWithPercentage((float)currentPercentage); SwipeTableCellMode mode = SwipeTableCellMode.None; SwipeCompletionBlock completionBlock = null; switch (state) { case SwipeTableViewCellState.StateRightShort: mode = ModeForStateRightShort; completionBlock = CompletionBlockRightShort; break; case SwipeTableViewCellState.StateRightLong: mode = ModeForStateRightLong; completionBlock = CompletionBlockRightLong; break; case SwipeTableViewCellState.StateLeftShort: mode = ModeForStateLeftShort; completionBlock = CompletionBlockLeftShort; break; case SwipeTableViewCellState.StateLeftLong: mode = ModeForStateLeftLong; completionBlock = CompletionBlockLeftLong; break; default: break; } if (completionBlock != null) { completionBlock(cell, state, mode); } }
public void SetSwipeGestureWithView(UIView view, UIColor color, SwipeTableCellMode mode, SwipeTableViewCellState state, SwipeCompletionBlock completionBlock) { gr.setSwipeGestureWithView(view, color, mode, state, completionBlock); }