ButtonAndLabelActivitySpinner 0.1.1

ButtonAndLabelActivitySpinner 0.1.1

测试已测试
Lang语言 SwiftSwift
许可 MIT
发布最后发布2016 年 9 月
SPM支持 SPM

Manish Reddy 维护。



  • 作者:
  • Manish Reddy

描述

可以显示活动指示器而不是文本的标签和按钮,以表示请求正在处理。

Animating.gif

用法

添加一个标签或按钮,并将其类声明为 For Button: ButtonActivitySpinner For Label: LabelActivitySpinner 和 Module: ButtonAndLabelActivitySpinner

Screen Shot 2016-09-05 at 2.33.06 PM.png Screen Shot 2016-09-05 at 2.33.20 PM.png

然后在代码中,在请求处理期间,使用以下内容以按钮或标签的中心开始活动指示器:

#!

Button.startAnimating()
Label.startAnimating()

to start the activity indicator in the center of button of label.

要停止动画,使用以下内容停止活动指示器的动画:

#!

Button.stopanimating
Label.stopanimating

to stop the activity indicator from animating.

您还可以通过以下方式更改活动指示器的颜色:

#!

Button.activityIndicator.color = UIColor.blueColor()

Cocoa Pods

Cocoa Pods 是 Cocoa 项目的依赖项管理器。您可以使用以下命令安装它

#!

$ gem install cocoa pods

要将 ButtonAndLableActivitySpinner 集成到使用 CocoaPods 的 Xcode 项目中,请将以下内容指定在您的 Podfile 中

#!

source 'https://[email protected]/reddymk/buttonandlabelactivityspinner.git'
platform :ios, '9.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'ButtonAndLabelActivitySpinner', '~> 1.0'
end

运行以下命令

#!

$ pod install

作者

Manish Reddy