Skip to content

kristoff2016/TinderSwipeView

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tinder Swipe View Swift 4.0.x

Inspired animation from Tinder and Potluck with random undo feature!

Run in physical device for better animaton!!!!

Preview

Size Limit example Size Limit example

Screenshot

Size Limit example Size Limit example

Instantiation

Tinder Swipe can be added to storyboard or instantiated programmatically:

func createTinderCard(at index: Int , value :String) -> TinderCard {

        let card = TinderCard(frame: CGRect(x: 0, y: 0, width: viewTinderBackGround.frame.size.width , height:   viewTinderBackGround.frame.size.height - 50) ,value : value)
        card.delegate = self
        return card
}

Animation

func rightClickAction(){
    let card = currentLoadedCardsArray.first
    card?.rightClickAction()
    }

func leftClickAction(){
    let card = currentLoadedCardsArray.first
    card?.leftClickAction()
    }

func makeUndoAction(){
    let card = currentLoadedCardsArray.first
    undoCard.makeUndoAction()
    }

func discardCard(){
    let card = currentLoadedCardsArray.first
    undoCard.makeUndoAction()
    }

func shakeAnimationCard(){
    let card = currentLoadedCardsArray.first
    card?.shakeAnimationCard()
    }

Delegate Methods

Here is a list of callbacks you can listen to:

protocol TinderCardDelegate: NSObjectProtocol {
    func cardGoesLeft(card: TinderCard)
    func cardGoesRight(card: TinderCard)
    func currentCardStatus(card: TinderCard, distance: CGFloat)
}

Requirements

* Swift 4.1
* XCode 9
* iOS 8.0 (Min SDK)

Author

Nicky Patson

HomePage

[email protected]

License

Tinder Swipe View is available under the MIT license. See the LICENSE file for more info.

About

Swipe view inspired by tinder

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Swift 100.0%