$ npm install rn-ph-gestures --save
$ react-native link rn-ph-gestures
- In XCode, in the project navigator, right click
Libraries
➜Add Files to [your project's name]
- Go to
node_modules
➜rn-ph-gestures
and addRNGestures.xcodeproj
- In XCode, in the project navigator, select your project. Add
libRNGestures.a
to your project'sBuild Phases
➜Link Binary With Libraries
- Run your project (
Cmd+R
)<
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
});