This project is already available but needs a lot of functionalities
🚧🚧 Project is not completely set. CocoaPods is not available for now. 🚧🚧
import SwiftyGestureRecognizer
You will need to attach the gesture on the UIView
you want by calling the constructor init(for: UIView)
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
GestureRecognizer.get(contactLabel).pressed { (label, recognizer) in
label.textColor = .red
}
}
You can chain every gestures
GestureRecognizer.get(contactLabel).rotatable().pannable().pressed { (label, recognizer) in
label.textColor = .red
}
Do no miss to uninstall before the view will disappear by calling the class function uninstallAll()
override func viewWillDisappear(_ animated: Bool) {
super.viewDidDisappear(animated)
GestureRecognizer.uninstallAll() // uninstall all recognizers
}
SwiftyGestureRecognizer is made to ensure the complete UIGestureRecognizer API, we need to take care about all methods.
Expected work:
UISwipeGestureRecognizer
UIScreenEdgePanGestureRecognizer
UILongPressGestureRecognizer
- If you'd like to ask a general question, use Stack Overflow.
- If you found a bug, and can provide steps to reliably reproduce it, open an issue.
- If you want to contribute, submit a pull request.
SwiftyGestureRecognizer is available under the MIT license. See the LICENSE file for more info.