ANLongTapButton 1.2.0

ANLongTapButton 1.2.0

测试已测试
语言语言 SwiftSwift
许可证 MIT
发布最新版本2016年7月
SPM支持 SPM

Sergey Demchenko 维护。



  • Sergey Demchenko

ANLongTapButton

带有动画进度条的长时间按按钮。

要求

  • iOS 8.0+
  • Swift 2.0+
  • ARC

使用方法

  • 在 IB 中将 UIButton 添加到您的视图中。
  • 在 IB 中将 UIButton 的类设置为 ANLongTapButton。
  • 在 IB 中将 UIButton 的模块名称设置为 ANLongTapButton。
  • 在 IB 中将动作拖动到控制器上,带有触摸事件(不是触摸内抬起!)。
  • 在您的动作方法中,添加 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)
  }
}

参见示例项目以获取更多详细信息。

作者

Sergey Demchenko, [[email protected]]

许可证

ANLongTapButton 免费提供 MIT 许可证。有关更多详细信息,请参阅 LICENSE 文件。