网站/小程序/APP个性化定制开发,二开,改版等服务,加扣:8582-36016

Swift支持自定义的指示器小控件

应用介绍

作者BearLatte,源码TIMProgressHUD,Swift 非常好用的指示器小控件,可根据自己的需要定制主题颜色,自定义动画等。已适配 Swift 5.0, 可以完美适配暗黑模式和普通模式的切换

如果使用的好的话,希望您不要吝啬,赏小的一颗小星星,谢谢!


本项目参考了Harley-xk  Chrysan. 原作者项目中采用了 Objective-C 的添加关联对象的方式动态将控件添加到 View 以及 ViewController 中,个人觉得不太 Swift。所以产生了本项目,我的思路是使用 RxSwift 的添加前缀的方式通过泛型将控件添加到 View 以及 ViewController 中。具体步骤可以参考 Demo。

Example - 代码示例

运行demo可以得到以下效果

现实文字提示 显示菊花和文字提示 显示进度提示 显示自定义文字进度提示 显示自定义动画提示

Requirements - 必要条件

  • Xcode 10.0 ~>

  • Swift 5.0 ~>

Installation - 导入方式

  • Cocoapods - 使用 Cocoapods 导入方法:

TIMProgressHUD 可以通过 Cocoapods 进行导入,也可以通过源代码进行导入,在你项目中的 Podfile 中添加以下代码:

TIMProgressHUD is available through CocoaPods. To install it, simply add the following line to your Podfile:

# 如果是 Cocoapods 1.8.0 版本或以上的用户请添加 CocoaPods 源在你的 Podfile 文件最顶部添加source 'https://github.com/CocoaPods/Specs.git'		# 添加这一句,不然会报 cdn 错误target 'xxx' do
	pod 'TIMProgressHUD'end

打开命令行工具,进入到 Podfile 所在文件夹,执行 pod install  pod update

Open Terminal;

Go to the directory where Podfile is located;

Execute pod install or pod update.

  • Source code - 源代码导入

    Download the TIMProgressHUD via zip;

    通过 zip 的方式下载源代码;

    Drag the TIMProgressHUD folder into your project (Don't forget tick the checkbox that copy item if needed);

    拖拽 TIMProgressHUD 文件夹到你的项目中(不要忘记勾选 copy item if needed 复选框);

Useg - 使用方式

  • If you installed TIMProgressHUD via Cocoapods , where you need it import TIMProgressHUD . Use the following statement to call up the control.

  • 如果你通过 Cocoapods 导入本项目,在你需要的地方或者项目的全局父类中 import TIMProgressHUD。使用以下语句吊起控件。

  • If you installed TIMProgressHUD via source code, Use the following statement to call up the control.

  • 如果你通过源代码的方式安装本项目,可以直接使用下面的语句吊起控件。

    tm.progressHUD.show()

Author - 作者

Tim, guoyong19890907@gmail.com

 


立即下载

温馨提示! 你需要支付 1.00P币后才可以下载

评论 共有 0 条评论

暂无评论
0
0
0
立即
投稿
发表
评论
返回
顶部