Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

swipeButtonsForDirection detects both directions when swiping from right to left #328

Open
onthecodepath opened this issue Jan 29, 2019 · 0 comments

Comments

@onthecodepath
Copy link

onthecodepath commented Jan 29, 2019

Hi,

I'm encountering what I suspect to be a bug where I implement logic in the swipeButtonsForDirection delegate method and it detects both directions were swiped when I only swiped from right to left.

Example code below:

@objc func swipeTableCell(_ cell: MGSwipeTableCell!, swipeButtonsForDirection direction: MGSwipeDirection, swipeSettings: MGSwipeSettings!, expansionSettings: MGSwipeExpansionSettings!) -> [Any]! {
    if direction == .leftToRight {
        print("User swiped left to right")
        return nil
    } else if direction == .rightToLeft {
        print("User swiped right to left")
        return nil
    } else {
        return nil
    }
}

Swiping from right to left results in the below getting printed to the console:
"User swiped left to right"
"User swiped right to left"

I should only expect the console to print "User swiped right to left".

Is anyone else running into the same issue? You can also just breakpoint and detect that direction is equal to both directions when you swipe from right to left

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant