MDCSwipeToChoose icon indicating copy to clipboard operation
MDCSwipeToChoose copied to clipboard

Disable swipe, only use the upvote and downvote button

Open sebasdeweert opened this issue 10 years ago • 3 comments

Hi,

At first, thank you so much for the amazing work!

I would like to disable the swiping between images to upvote or downvote. I would only like to use the green and red thumb for upvote or downvote.

How can I make this possible? I found the void setupSwipeToChoose but when I remove this the first image will work, the second image will be stuck on the screen.

Thank you!

sebasdeweert avatar Oct 28 '14 17:10 sebasdeweert

This might be a good feature to add; thanks for the idea! I don't think there's a way to do this at the moment, though. :speak_no_evil: :broken_heart:

modocache avatar Oct 28 '14 17:10 modocache

Any updates? Quite helpful to have.

grabbou avatar Mar 27 '15 15:03 grabbou

I was able to prevent swiping by adding another view on top of the frontCardView. Then I used a completion block which I call in ChoosePersonView to remove that view after an image for the ChoosePersonView successfully loads asynchronously. You could use a delegate, completion block, or some other way to make the call to remove that view that prevents swiping. Hope this helps.

        var frontCardPreventSwipeView = UIView(frame: frontCardViewFrame())
        frontCardPreventSwipeView.backgroundColor = UIColor.clearColor()
        frontCardView = popPersonViewWithFrame(
            frontCardViewFrame(),
            {() -> Void in
                frontCardPreventSwipeView.removeFromSuperview()
            }
        )

        if(frontCardView != nil) {
            view.addSubview(frontCardView)
            view.insertSubview(frontCardPreventSwipeView, aboveSubview: frontCardView)

        }

jonathanxie avatar Mar 31 '15 09:03 jonathanxie