Sensitive is an open source Swift library from Igor Matyushkin that provides a very simple syntax for handling the most common gestures.
With Sensitive you don’t need to worry about utilizing UIGestureRecognizer but rather simply add the Sensitive gesture handlers to a UIView, set your callback, and configure some variables.
This example shows how one would set up a simple double tap gesture recognizer that changes the view color.:
view.onTap({ (tapGestureRecognizer) -> Void in
// Handle tap on view
view.backgroundColor = .greenColor()
}) { (tapGestureRecognizer) -> Void in
// Configure gesture recognizer
tapGestureRecognizer.numberOfTouchesRequired = 1
tapGestureRecognizer.numberOfTapsRequired = 2
}
Within sensitive are gesture handlers for tap, swipe, pan, pinch, and rotation gestures.
You can find Sensitive on Github here.
A nice simple way to handle gestures with a clean Swift syntax.
Original article: Sensitive – Swift Library That Dramatically Simplifies Implementing Common Gesture Support
©2016 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.
Reference source: iOS App Dev Libraries, Controls, Tutorials, Examples and Tools