Giter VIP home page Giter VIP logo

dwswipegesture's Introduction

DWSwipeGestures

#如果喜欢,请Star #使用中如果遇到问题,可以加群:577506623 #向大家推荐一个全新的开发者交流、代码分享平台:CodeData

###简化手势使用,支持CocoaPods导入📦

CocoaPods

 platform :ios, '8.0'
 pod 'DWSwipeGestures'#简化手势使用

#Clone cd 本地路径 --- git clone https://github.com/dwanghello/DWSwipeGesture.git


####导入封装完成文件 DWSwipeGestures.h & DWSwipeGestures.m 或者直接将文件夹导入(DWSwipeGestures)


#使用 ####1、导入头文件/创建对象 #import "DWSwipeGestures.h"

@property (strong, nonatomic) DWSwipeGestures *swip;

//懒加载
- (DWSwipeGestures *)swip {

	 if (!_swip) {
    
	 _swip = [[DWSwipeGestures alloc] init];
    
	 }

	return _swip;

}


####2、创建手势/添加手势方法

//需要进行几次点击/只有敲击手势时才使用此属性/默认为1
  self.swip.numberOfTapsRequired = 2;

//需要进行操作的手指数量/默认为1
self.swip.numberOfTouchesRequired = 2;

   /*!
    *  @author dwang_sui, 16-07-14 22:07:59
    *
    *  @brief 添加手势
    *  @param swipeGesture                手势类型
    *  @param target                      方法执行者
    *  @param action                      方法名
    *  @param view                        手势添加视图
    *  @param backSwipeGestureTypeString  返回出设置的手势类型
    *
    */
[self.swip dw_SwipeGestureType:DWUpSwipeGestures Target:self Action:@selector(click) AddView:self.view BackSwipeGestureTypeString:^(NSString * _Nonnull backSwipeGestureTypeString) {
    
    NSLog(@"%@",backSwipeGestureTypeString);
    
}];


  - (void)click {

    NSLog(@"选择类型为第%lu个枚举值",(unsigned long)self.swip.swipeGestureType);    

      /**
      *  删除手势
      *
      *  @param swipeGestureType 需要删除的手势类型
  	*/
  	 [self.swip dw_RemoveSwipeGesture:DWUpSwipeGestures];

}

#欢迎各位使用,如果有什么更好的使用想法,可以私密我。

dwswipegesture's People

Watchers

James Cloos avatar meliuxudong 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.