Skip to content

alextakahashi/SwipeSelectorKit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

👉 SwipeSelectorKit - Hackathon Starter Project

Swipe Selector Kit Demo

TL;DR Swipe Right, Swipe Left - That's it. Have a hackthon idea? Fork this and build something cool!

This project was inspired by a few hackathon designs I've seen this year while mentoring for Cal Hacks. This swipeable UI is a popular design pattern to accept/reject a list of items.

Interactions

  • Swipe Right - accept
  • Swipe Left - reject

Getting Started

  1. ✅ Fork the Project
  2. ✅ Build + Run
  3. ✅ Swipe!

Try it Yourself

class SwipeSelectorViewController: UIViewController, SwipeSelectorDelegate {
    
    var swipeSelectorView = SwipeSelectorView()
    
    override func viewDidLoad() {
        super.viewDidLoad()
        swipeSelectorView = SwipeSelectorView(delegate: self)
        self.view.addSubview(swipeSelectorView)
    }
    
    override func viewDidLayoutSubviews() {
        super.viewDidLayoutSubviews()
        swipeSelectorView.frame = self.view.frame
    }
    
    // MARK: SwipeSelectorDelegate
    
    func swipeSelectorViewNumberOfItems(_ swipeSelectorView: SwipeSelectorView) -> Int {
      // DataSource ...
    }
    
    func swipeSelectorViewItemForOverflow(_ swipeSelectorView: SwipeSelectorView) -> SwipeSelectorModel {
      // DataSource ...
    }
    
    func swipeSelectorView(_ swipeSelectorView: SwipeSelectorView, itemForRowAtIndex: Int) -> SwipeSelectorModel {
      // Configure Cards ...
    }
    
    func swipeSelectorViewDidSwipe(_ swipeSelectorView: SwipeSelectorView, itemAtIndex: Int, isRightSwipe: Bool) {
      // Handle Swipes ...
    }
    
    func swipeSelectorViewDidTap(_ swipeSelectorView: SwipeSelectorView, itemAtIndex: Int) {
      // Handle Tapping Specific Cards
    }
}

Help Improve This Project!

Prerequisites

  • Xcode 12.0+

Authors

Acknowledgments

Liability

I am not a lawyer, but no guarantees if this breaks, totally not responsible if things go to shit - don't sue me, kthx. Add MIT License.

About

Swipe Right, Swipe Left - That's it

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages