Touch Gesture (swipe from edge)

Hi, I am looking to implement a touch gesture in my game app for mobile devices. I need the player to perform a Touch Gesture (swipe from edge) and for a quick menu to appear. Any info on how I can go about this?

Here’s how I see it:
Check if a touch starts with a X position <30. Start a timer and check X position when the touch ends, and check how long it lasted. If it moved for more than 50 pixels in less than a split-second, it should be a swipe, I think.