How to delete a UIView (KolodaView) when dragged view touch Cross Button?

119 Views Asked by At

I am using Koloda Library from there https://github.com/Yalantis/Koloda I have modify the default project according to my need. Here is my current screen image enter image description here . Now I want to delete a UIView (kolodaView) when the card (kolodaView) dragged to cross button.I know how to delete a card but I am not getting the condition when card and button matches. Here is my code

func kolodaPanFinished(_ koloda: KolodaView, card: DraggableCardView) {

    if card.frame.intersects(leftButton.frame){
        print("Frame of card",kolodaView.frame)
        print("Frame of Button",leftButton.frame)
        //dataSource.remove(at: tempIndex)
        print("Deleted")
        self.resetMe()
    }
}
0

There are 0 best solutions below