ZLSwipeableView icon indicating copy to clipboard operation
ZLSwipeableView copied to clipboard

Disable swiping until topSwipeableView clears

Open dlrifkin opened this issue 10 years ago • 1 comments

hello, any way to disable gestures for the next view until topSwipeableView is discarded? thank you for your help!

dlrifkin avatar Jul 29 '15 19:07 dlrifkin

I've been looking for this too. I might try to implement this by myself since I think there's no solution for this yet.

Edit: what I found out so far is that there's a delegate method implemented in ZLSwipeableViewSwipingDeterminator that can be used like below:

- (BOOL)shouldSwipeView:(UIView *)view
               movement:(ZLSwipeableViewMovement *)movement
          swipeableView:(ZLSwipeableView *)swipeableView {
    if ([view isEqual:swipeableView.topView]) {
        return YES;
    }
    return NO;
}

This code will only prevent the undesired view from completing the swipe (and being discarded), but it's still possible to grab and drag it. Options like "setUserInteractionEnabled" to NO didn't work so far.

It's something.

rogerluan avatar Apr 26 '16 01:04 rogerluan