NiceGesture
The best way to use UIGesture
Usage
TapGesture:
because tapGesture is only have one state,so it's only have method whenTapped
LongPress,Pan,Pinch,Rotate,Swipe,ScreenEdgesPan:
if you want to cinfigure gesture,use this method:
if you needn't configure,use this method to start:
then,you can add hanlder function as you want:
a convenient way to use SwipeGesture:
or if you want set one handler for many states,use whenStatesHappend
:
Attention
Custom gestureRecognizerHandler is retained by UIGestureRecognizer , UIGestureRecognizer is retained by target view, so if you're using self property remeber explicit [unowned self]
to avoid retain cycle:
Installation
CocoaPods
To integrate NiceGesture into your Xcode project using CocoaPods, specify it in your Podfile:
Manual
Just copy the files which under NiceGesture folder to your project
Carthage
github "lacklock/NiceGesture"
Contact
Weibo : @没故事的卓同学