Coder Social home page Coder Social logo

nicegesture's Introduction

NiceGesture

Build Status 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
            
       }

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

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

#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 Soon will coming...

#Contact

Weibo : @没故事的卓同学

License

NiceGesture is available under the MIT license. See the LICENSE file for more info.

nicegesture's People

Contributors

lacklock avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.