Skip to content

Latest commit

 

History

History
54 lines (39 loc) · 1.54 KB

README.md

File metadata and controls

54 lines (39 loc) · 1.54 KB

ANLongTapButton

Cocoapods Compatible Swift 4.2

Long tap button with animated progress bar.

Requirements

  • iOS 8.0+
  • Swift 4.2
  • ARC

##Installation

####CocoaPods Available on CocoaPods. Just add the following to your project Podfile:

pod 'ANLongTapButton'
use_frameworks!

Usage

  • In IB add UIButton to your view.
  • In IB set class of UIButton to ANLongTapButton.
  • In IB set module name of UIButton to ANLongTapButton.
  • In IB drag action to your controller with Touch Down Event (NOT Touch Up Inside!).
  • In your action method add implement didTimePeriodElapseBlock.
@IBAction func onPayNowButtonTapped(longTapButton: ANLongTapButton)
{
  longTapButton.didTimePeriodElapseBlock = { () -> Void in
    let alert = UIAlertController(title: "Payment", message: "Payment has been made.", preferredStyle:   UIAlertControllerStyle.Alert)
    alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: nil))
    self.presentViewController(alert, animated: true, completion: nil)
  }
}

See example project for more details.

Author

Sergey Demchenko, antrix1989@gmail.com

License

ANLongTapButton is available under the MIT license. See the LICENSE file for more info.