ANLongTapButton
ANLongTapButton copied to clipboard
Long tap button with animated progress bar.
ANLongTapButton
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, [email protected]
License
ANLongTapButton is available under the MIT license. See the LICENSE file for more info.