UISlider in UITableView not responding to napkin

I am trying to insert a UISlider into a UITableViewCell but the gesture gesture is not working correctly. For sliding hold and thumb movement, but I want the swipe gesture not to hold. I think the tableview's own gestures do not allow this, but I don't know how to disable it.

+3


source to share


2 answers


Use - gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:

 YES to set the property. You can then add a feature check to decide which gesture to act on.



0


source


I recently faced the same problem. This happens for me in a static UITableViewController cell created from a storyboard. I found an ugly workaround, but would love to see a better solution for this.

So, I disabled all self.view and self.view.superview UITableViewController gesture recognizers:



- (void)disableGestureRecognisersInView:(UIView*)view {

    for ( UIView *subview in view.subviews ) {
        for ( UIGestureRecognizer *rec in subview.gestureRecognizers ) {
            rec.enabled = NO;
    }
}

- (void)viewWillAppear:(BOOL)animated {

    [super viewWillAppear:animated];

    [self disableGestureRecognisersInView:self.view];
    [self disableGestureRecognisersInView:self.view.superview];
}

      

And now UISlider is working fine, didn't notice any other issue due to this workaround. But I still don't like it.

0


source







All Articles