ios-swift版本提示框XLProgressHUD 指示器.zip
由于公司项目开始转为swift版本,ProgressHUD目前网上也没有很好的swift版本,自己模仿OC的toast写的一个swift版本。可以使用CocoaPods集成在项目中,使用非常简单方便。如有问题的地方还请各位大神多多指点。如果对你有用,可以star下,谢谢! swift版本指示器,基本所有项目中都会用到的。功能和OC版本的toast、MBProgressHUD基本相同、 CocoaPods CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command: $ gem install cocoapods To integrate XLProgressHUD into your Xcode project using CocoaPods, specify it in your 'Podfile' : source 'https://github.com/CocoaPods/Specs.git' platform :ios, '8.0' use_frameworks! target '' do pod 'XLProgressHUD', '~> 1.0.5' end Then, run the following command: $ pod install Usage Introduce import XLProgressHUD Use Code 1、单独内容信息提示 let message = "修改成功" view.showMessage(message, interval: 0.2, position: "top") 2、内容信息 + 图片 提示 let message = "修改成功" view.showMessageAndImage(message, image: UIImage(named: "true_icon"), interval: 0.2, position: "center") 3、标题信息 + 内容信息 + 图片 提示 let title = " 2" let message = "恭喜你!答对了" view.showTitleMessageAndImage(title, message: message, image: UIImage(named: "coins_big_icon"), interval: 0.2, position: "bottom") 4、网络请求持久显示提示 let message = "加载中..." view.showLoadingTilteActivity(message, position: "center") // 模拟网络数据加载设置的显示时间 let delayTime = dispatch_time(DISPATCH_TIME_NOW, Int64(1 * Double(NSEC_PER_SEC))) dispatch_after(delayTime, dispatch_get_main_queue()) { () -> Void in // 隐藏提示视图 self.view.hideActivity() } Parameter description title: 显示提示框上部的文字参数 message: 显示提示下部的文字提示框 image: 显示提示框里面的图片参数 interval: 显示提示框显示时间的参数 position: 显示提示框显示位置 使用填入参数为("top" "center" "bottom") 默认为nil时现在在中部位置
- 1
- 粉丝: 409
- 资源: 1万+
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助