Android App Development
iOS App Development
Flutter App Development
Cross Platform App Development
Hire on-demand project developers and turn your idea into working reality.
Big thanks to Webkul and his team for helping get Opencart 3.0.3.7 release ready!
Deniel Kerr
Founder. Opencart
Top Partners
Swipe Gesture Recognizer is a very common and important feature. it is used when we drag a finger towards a direction (left, right, top, down).
An example of the swipe gesture exists in the photos gallery app where we use swipe gestures to slide from one photo to another
We can add swipe gestures to any view. For example, we have a custom view over your app and we want to remove it if the user swipe from left to right. For that, we need to add a gesture recognizer to that view.
Now, we are going to apply Swipe gestures on UIView.
Let’s Start
Now, Add UISwipeGestureRecognizer and create an object for swipe Gesture
Note:- A swipe gesture recognizer object monitor and perform an action only one direction, so if you want to support swiping towards two or more directions then you have to create two and more recognizer objects respectively
Note:- set UISwipeGestureRecognizer in viewDidLoad function.
Let’s Create a method that is performing an action when the UISwipeGestureRecognizer perform
Let’s run the project and check the swipe gesture, try to swipe left, right, top, down.
Conclusion :
Swipe gestures allow us to move a view to any of the four directions:- left, right, top, down. But not in a diagonal way.
I hope this blog helps you to understand the basics of UISwipeGestureRecognizer. it is very easy and simple to use and make your application interactive
Lastly, Please share your thoughts with us in the comment area.
Your email address will not be published. Required fields are marked*
Name*
Email*
Save my name email and website in this browser for the next time I comment.
Be the first to comment.
We use cookies to personalize your experience. By continuing to visit this website you agree to our use of cookies. Learn more about privacy policy
All communication is done through a ticket system. I appreciate the regular almost daily updates of what is being worked on, and communicating changes or updates is easy through this system. Mobikul's response timeframe is quick.
Josh Arnold
Owner, Shop ATV Escape
USA
India
Global
Name
Email
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.