Latest 0.1.2
Homepage https://github.com/cflatinc/CFPressHoldButton
License MIT
Platforms ios , requires ARC
Authors

Installation

CocoaPods

CocoaPods.org – The Dependency Manager for Objective C.

Podfile

# Podfile
pod "CFPressHoldButton", :git => "https://github.com/cflatinc/CFPressHoldButton.git"

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");
}

Latest podspec

{
    "name": "CFPressHoldButton",
    "version": "0.1.2",
    "summary": "Press and hold button for iOS",
    "homepage": "https://github.com/cflatinc/CFPressHoldButton",
    "license": {
        "type": "MIT"
    },
    "authors": {
        "ohno": "[email protected]"
    },
    "platforms": {
        "ios": null
    },
    "source": {
        "git": "https://github.com/cflatinc/CFPressHoldButton.git",
        "tag": "0.1.2"
    },
    "source_files": [
        "Classes",
        "Classes/**/*.{h,m}"
    ],
    "public_header_files": "Classes/**/*.h",
    "requires_arc": true
}

Pin It on Pinterest

Share This