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

react-native-touch-gestures

Package Overview
Dependencies
Maintainers
2
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-touch-gestures

Native gesture recognizers in React Native

  • 1.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-71.43%
Maintainers
2
Weekly downloads
 
Created
Source

react-native-touch-gestures

Native gestures in React Native

Getting started

$ npm install react-native-touch-gestures --save

Mostly automatic installation

$ react-native link react-native-touch-gestures

Manual installation

iOS
  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesreact-native-touch-gestures and add RNGGestures.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRNGGestures.a to your project's Build PhasesLink Binary With Libraries
  4. Run your project (Cmd+R)<

Usage

import Gestures from 'react-native-touch-gestures';

class Example extends Component {
  render() {
    return (
      <View>
        <Gestures.View // Wrap the view with the Gestures view that recognizes pinch
          onPinch={this.onPinch}
          onTap={this.onTap}
          onPan={this.onPan}
        >
          <Text>hello world</Text>
        </Gestures.View>
      </View>
    );
  }
  
  onPinch(event) {
    console.log(
      'onPinch -- ',
      'gestureId: ', event.nativeEvent.gestureId, // unique id per gesture
      'action: ', event.nativeEvent.action, // 'start' | 'change' | 'finish'
      'scale: ', event.nativeEvent.scale
    );
  }

  onTap(event) {
    console.log(
      'onTap -- ',
      'gestureId: ', event.nativeEvent.gestureId // unique id per gesture
    );
  }

  onPan(event) {
    console.log(
    'onPan -- ',
    'gestureId: ', event.nativeEvent.gestureId,
      'action: ', event.nativeEvent.action, // 'start' | 'change' | 'finish'
      'x: ', event.nativeEvent.x,
      'y: ', event.nativeEvent.y
    );
  }
}

Roadmap

  • Add support for Android
  • Add support for more gestures

Keywords

FAQs

Package last updated on 04 Sep 2017

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