Added a method that enable or disabled the swipe gesture