Here's a code snippet that demonstrates how to create a horizontal swipe gesture recognizer in Swift using UIKit:
main.swift631 chars14 lines
You can configure the direction
property of the gesture recognizer to be .left
or .right
depending on which direction you want your horizontal swipe to be recognized in. You can also change the action that is taken when the gesture is recognized to fit your application's needs.
gistlibby LogSnag