Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

react native detect swipe

<View
      onTouchStart={e=> this.touchY = e.nativeEvent.pageY}
      onTouchEnd={e => {
        if (this.touchY - e.nativeEvent.pageY > 20)
          console.log('Swiped up')
      }}
      style={{height: 300, backgroundColor: '#ccc'}}
    />
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #react #native #detect #swipe
ADD COMMENT
Topic
Name
4+1 =