Calls a function after a swipe with touch or click event