Popularity
2.7
Growing
Activity
0.0
Stable
106
6
11

Code Quality Rank: L5
Monthly Downloads: 0
Programming language: Swift
License: MIT License
Tags: Gesture    
Latest version: v1.0.1

NiceGesture alternatives and similar libraries

Based on the "Gesture" category

Do you think we are missing an alternative of NiceGesture or a related project?

Add another 'Gesture' Library

README

NiceGesture

Build Status Language Carthage compatible CocoaPods License

The best way to use UIGesture

Usage

TapGesture:

because tapGesture is only have one state,so it's only have method whenTapped


  view.nc_addTapGestureWithConfigClosure { (tapGestureRecognizer) -> () in
            // Configure gesture recognizer,like this:
            tapGestureRecognizer.numberOfTapsRequired=2
        }.whenTapped {(tapGestureRecognizer) -> () in
            //doSomething()
        }

  // or you can directly do something 
  view.nc_whenTapped {(tapGestureRecognizer) -> () in
        //doSomething()
  }

LongPress,Pan,Pinch,Rotate,Swipe,ScreenEdgesPan:

if you want to cinfigure gesture,use this method:


  view.nc_addxxxxGestureWithConfigClosure({ (gestureRecognizer) -> () in
        //Configure gesture recognizer
  })

if you needn't configure,use this method to start:


  view.nc_addxxxxGesture()

then,you can add hanlder function as you want:


   view.nc_addPanGesture()
       .whenBegan { (recognizer) -> Void in

       }.whenCancelled { (recognizer) -> Void in

       }.whenChanged { (recognizer) -> Void in

       }.whenEnded { (recognizer) -> Void in

       }.whenFailed { (recognizer) -> Void in

       }

a convenient way to use SwipeGesture:


   view.nc_whenSwipedInDirection(.Down) { (gestureRecognizer) in

        }

or if you want set one handler for many states,use whenStatesHappend:


lbState.nc_addPanGesture().whenStatesHappend([.Ended,.Changed]) { (gestureRecognizer) -> Void in

        }

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:

 lbState.nc_whenSwipedInDirection(.Down) {[unowned self]  (gestureRecognizer) in
            self.lbState.text="Down"
        }

Installation

CocoaPods

To integrate NiceGesture into your Xcode project using CocoaPods, specify it in your Podfile:

platform :ios, '8.0'
use_frameworks!

pod 'NiceGesture'

Manual

Just copy the files which under NiceGesture folder to your project

Carthage

github "lacklock/NiceGesture"

Contact

Weibo : @没故事的卓同学

License

NiceGesture is available under the MIT license. See the [LICENSE](./LICENSE) file for more info.


*Note that all licence references and agreements mentioned in the NiceGesture README section above are relevant to that project's source code only.