Long tap button with animated progress bar.
- iOS 8.0+
- Swift 4.2
- ARC
##Installation
####CocoaPods Available on CocoaPods. Just add the following to your project Podfile:
pod 'ANLongTapButton'
use_frameworks!
- 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.
Sergey Demchenko, [email protected]
ANLongTapButton is available under the MIT license. See the LICENSE file for more info.