CFPressHoldButton 0.1.2

CFPressHoldButton 0.1.2

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Dec 2014

Maintained by xoyip.



  • By
  • ohno

Installation

Manual

Download these files from this repo, then import to your project.

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

Usage

Inherits CFPressHoldButtonDelegate on your view controller.

// ViewController.h

#import <UIView+CFPressHoldButton.h>

@interface ViewController : UITableViewController<CFPressHoldButtonDelegate>
@end

Set delegate object.

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

Implements delegate methods.

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

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