1.1.1 • Published 8 years ago
rn-ph-gestures v1.1.1
Physical gestures
Getting started
$ npm install rn-ph-gestures --save
Mostly automatic installation
$ react-native link rn-ph-gestures
Manual installation
iOS
- In XCode, in the project navigator, right click Libraries➜Add Files to [your project's name]
- Go to node_modules➜rn-ph-gesturesand addRNGestures.xcodeproj
- In XCode, in the project navigator, select your project. Add libRNGestures.ato your project'sBuild Phases➜Link Binary With Libraries
- Run your project (Cmd+R)<
Usage
import RNGestures from 'rn-ph-gestures';
//Registering Listener
RNGestures.registerMovementDetection(3, 2000);
//Unregistering Listener
 RNGestures.stopMovementDetection();
//Listening events
DeviceEventEmitter.addListener("MOVING", () => {
    // Do your stuff
});
DeviceEventEmitter.addListener("STATIONARY", () => {
    // Do your stuff
});