CFPressHoldButton 0.1.2

CFPressHoldButton 0.1.2

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
发布最后发布2014年12月

xoyip 维护。



  • ohno

安装

手动

从该仓库下载这些文件,然后导入到您的项目中。

  • Classes/CFPressHoldButton.h
  • Classes/CFPressHoldButton.m

用法

在您的视图控制器中继承 CFPressHoldButtonDelegate

// ViewController.h

#import <UIView+CFPressHoldButton.h>

@interface ViewController : UITableViewController<CFPressHoldButtonDelegate>
@end

设置代理对象。

// ViewController.m
- (void)viewDidLoad
{
    UIView *pressHoldButton = // create view;
    pressHoldbutton.delegate = self;
}

实现代理方法。

- (void)didStartHolding:(UIView *)targetView
{
    NSLog(@"do something on starting");
}

- (void)didFinishHolding:(UIView *)targetView
{
    NSLog(@"do something on finishing");
}