Note that there are some explanatory texts on larger screens.

plurals
  1. POUITextfield interferes with swipe gestures
    primarykey
    data
    text
    <p>I've implemented this custom control in my project: <a href="https://github.com/alikaragoz/MCSwipeTableViewCell" rel="nofollow">Github page</a> this control adds a Mailbox like swipe to delete/complete feature which I would like to use.</p> <p>The only problem I've encountered when using this is if I add a UITextField to the cell via storyboards. When I add one the cell stops recognizing the gestures and only lets me interact with the UITextField. </p> <p>Does anyone have a remedy for this problem?</p> <p>Edit: Here is the initializer method of the TableViewCell. Sorry.</p> <pre><code>- (void)initializer { _mode = MCSwipeTableViewCellModeSwitch; _colorIndicatorView = [[UIView alloc] initWithFrame:self.bounds]; [_colorIndicatorView setAutoresizingMask:UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth]; [_colorIndicatorView setBackgroundColor:[UIColor clearColor]]; [self insertSubview:_colorIndicatorView belowSubview:self.contentView]; _slidingImageView = [[UIImageView alloc] init]; [_slidingImageView setContentMode:UIViewContentModeCenter]; [_colorIndicatorView addSubview:_slidingImageView]; _panGestureRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePanGestureRecognizer:)]; [self addGestureRecognizer:_panGestureRecognizer]; [_panGestureRecognizer setDelegate:self]; } </code></pre> <p>and the method for handling the gesture</p> <pre><code>- (void)handlePanGestureRecognizer:(UIPanGestureRecognizer *)gesture { UIGestureRecognizerState state = [gesture state]; CGPoint translation = [gesture translationInView:self]; CGPoint velocity = [gesture velocityInView:self]; CGFloat percentage = [self percentageWithOffset:CGRectGetMinX(self.contentView.frame) relativeToWidth:CGRectGetWidth(self.bounds)]; NSTimeInterval animationDuration = [self animationDurationWithVelocity:velocity]; _direction = [self directionWithPercentage:percentage]; if (state == UIGestureRecognizerStateBegan) { } else if (state == UIGestureRecognizerStateBegan || state == UIGestureRecognizerStateChanged) { CGPoint center = {self.contentView.center.x + translation.x, self.contentView.center.y}; [self.contentView setCenter:center]; [self animateWithOffset:CGRectGetMinX(self.contentView.frame)]; [gesture setTranslation:CGPointZero inView:self]; } else if (state == UIGestureRecognizerStateEnded || state == UIGestureRecognizerStateCancelled) { _currentImageName = [self imageNameWithPercentage:percentage]; _currentPercentage = percentage; MCSwipeTableViewCellState state = [self stateWithPercentage:percentage]; if (_mode == MCSwipeTableViewCellModeExit &amp;&amp; _direction != MCSwipeTableViewCellDirectionCenter &amp;&amp; [self validateState:state]) [self moveWithDuration:animationDuration andDirection:_direction]; else [self bounceToOriginWithDirection:_direction]; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload