Latest 0.0.3
Homepage https://github.com/dwanghello/DWSwipeGesture
License MIT
Platforms ios 7.0
Frameworks Foundation, UIKit
Authors

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


CocoaPods

 platform :ios, '8.0'
 pod 'DWSwipeGesture'

Clone

cd Desktop/
---
git clone https://github.com/dwanghello/DWSwipeGesture.git

Demo地址:https://github.com/dwanghello/DWGesture

简书地址:http://www.jianshu.com/p/65f7bb87229d



导入封装完成文件

 DWSwipeGesture.h & DWSwipeGesture.m 或者直接将文件夹导入(DWSwipeGesture)


使用

1、导入头文件/创建对象

#import "DWSwipeGesture.h"

@property (strong, nonatomic) DWSwipeGesture *swip;

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

     if (!_swip) {

     _swip = [[DWSwipeGesture 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];

}

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

QQ:[739814184]()

验证信息请填写“Github”

Latest podspec

{
    "name": "DWSwipeGesture",
    "version": "0.0.3",
    "summary": "Simple to use gestures in iOS.",
    "description": "It is a simple call gestures library, used for iOS, implemented by the objective - c.",
    "homepage": "https://github.com/dwanghello/DWSwipeGesture",
    "license": "MIT",
    "authors": {
        "dwanghello": "[email protected]"
    },
    "source": {
        "git": "https://github.com/dwanghello/DWSwipeGesture.git",
        "tag": "0.0.3"
    },
    "platforms": {
        "ios": "7.0"
    },
    "source_files": "DWSwipeGesture/*",
    "frameworks": [
        "Foundation",
        "UIKit"
    ]
}

Pin It on Pinterest

Share This