MDCSwipeToChoose
MDCSwipeToChoose copied to clipboard
Disable swipe, only use the upvote and downvote button
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!
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:
Any updates? Quite helpful to have.
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)
}