ANLongTapButton 1.2.0

ANLongTapButton 1.2.0

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Jul 2016
SPMSupports SPM

Maintained by Sergey Demchenko.



  • By
  • Sergey Demchenko

ANLongTapButton

Long tap button with animated progress bar.

Requirements

  • iOS 8.0+
  • Swift 2.0+
  • ARC

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.