Open maxydey opened 5 years ago
How to use above method
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
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 notifications@github.com 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 https://github.com/Yalantis/Koloda/issues/429?email_source=notifications&email_token=AGBFSWAFWLRZJHU6XPF5OV3P3IOZRA5CNFSM4HN4AXNKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYBVADY#issuecomment-503533583, or mute the thread https://github.com/notifications/unsubscribe-auth/AGBFSWGXNQ3N4AZH3CR6RXDP3IOZRANCNFSM4HN4AXNA .
A feature request
What do you want to add?
Add
gestureRecognizer
toshouldDragCardAt
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 scrollHow should it look like?