Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

motion-swipe

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

motion-swipe

  • 0.0.7
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Motion-Swipe for RubyMotion

alt tag

Trying to add a Tinder-like swipe gem for RubyMotion. Not really production ready but useable. PRs for fixes, refactors and features accepted! This is also my first gem - advice/help is welcome.

This is a wrapper around Richard Kim's TinderSimpleSwipeCards written in obj-c. He does an excellent job detailing how it all works, so that you customize it easily. Some of that got erased when I was making this, so see his source: https://github.com/cwRichardKim/TinderSimpleSwipeCards

create a draggable view background

@draggable = MotionSwipe.build({
  frame: CGRectMake(0, 0, self.view.frame.width, self.view.frame.height),
  delegate: self # Needed if you want to call method of a class with your button
})

adjust the draggable view's height and width

@draggable.setCardWithHeight(@height, withWidth: width)

create a new draggable view, and add it to the draggable view background

new_card = @draggable.createDraggableView
@draggable.addCard(new_card)

now just append views, buttons, or whatever to that draggable view

# you can assign an id to the card for identification
new_card.cardId = card_id

make sure to load the cards you added into the draggable view background

# this method returns the number of cards
count = @draggable.loadCards()

methods are available to swipe cards left or right without a gesture

@draggable.swipeRight()
@draggable.swipeLeft()

NSUserDefaults are used to track the current card, previously swiped card, and previous swipe direction

@defaults = NSUserDefaults.standardUserDefaults
@defaults["cardCurrent"]
@defaults["cardSwiped"]
@defaults["cardSwipedDirection"]

FAQs

Package last updated on 14 Nov 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc