Add `gestureRecognizer` to `shouldDragCardAt` delegate method arguments
maxydey opened this issue · 3 comments
maxydey commented
A feature request
What do you want to add?
Add gestureRecognizer
to shouldDragCardAt
delegate method arguments. It will make easier blocking the swipe event, when the Koloda is inside a tableviewCell, and you don't want to mess with the scroll
How should it look like?
func koloda(_ koloda: KolodaView, shouldDragCardAt index: Int, gestureRecognizer: panGestureRecognizer) -> Bool
OmarIbbu commented
How to use above method
maxydey commented
at the moment I had to hack it like this:
func koloda(_ koloda: KolodaView, shouldDragCardAt index: Int) -> Bool {
let view = koloda.viewForCard(at: index)
guard let gesture = view?.superview?.gestureRecognizers?.first(where: { $0 as? UIPanGestureRecognizer != nil }) as? UIPanGestureRecognizer else { return true }
let translation = gesture.translation(in: nil)
return abs(translation.y) <= abs(translation.x)
}
My KolodaView is inside tableviewCell, so I need to prioritise the scrolling over the swiping cards, if gesture is vertical
OmarIbbu commented
Thanks for your kind help. I am applying shadow on the card but it is not
working. WIll you please help me in this regard.
…On Wed, 19 Jun 2019 at 17:40, Max ***@***.***> wrote:
at the moment I had to hack it like this:
func koloda(_ koloda: KolodaView, shouldDragCardAt index: Int) -> Bool {
let view = koloda.viewForCard(at: index)
guard let gesture = view?.superview?.gestureRecognizers?.first(where: { $0 as? UIPanGestureRecognizer != nil }) as? UIPanGestureRecognizer else { return true }
let translation = gesture.translation(in: nil)
return abs(translation.y) <= abs(translation.x)
}
My KolodaView is inside tableviewCell, so I need to prioritise the
scrolling over the swiping cards, if gesture is vertical
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#429?email_source=notifications&email_token=AGBFSWAFWLRZJHU6XPF5OV3P3IOZRA5CNFSM4HN4AXNKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYBVADY#issuecomment-503533583>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGBFSWGXNQ3N4AZH3CR6RXDP3IOZRANCNFSM4HN4AXNA>
.