1 Star 1 Fork 4K

java8dj/O2OA

Create your Gitee Account
Explore and code with more than 14 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
ZoneHUD.swift 1.68 KB
Copy Edit Raw Blame History
O2LEE authored 2019-01-04 14:42 +08:00 . 提交移动端源码
//
// ZoneHUD.swift
// O2Platform
//
// Created by 刘振兴 on 2017/3/16.
// Copyright © 2017年 zoneland. All rights reserved.
//
import UIKit
import JGProgressHUD
class ZoneHUD: NSObject {
private static var hud:JGProgressHUD {
struct HUDWrapper {
static let myHUD = JGProgressHUD(style: .light)
}
HUDWrapper.myHUD.interactionType = .blockAllTouches
HUDWrapper.myHUD.animation = JGProgressHUDFadeZoomAnimation()
HUDWrapper.myHUD.backgroundColor = UIColor.init(white: 0.0, alpha: 0.2)
return HUDWrapper.myHUD
}
public class func showNormalHUD(_ parentView:UIView,_ text:String = "loading...") {
ZoneHUD.hud.indicatorView = JGProgressHUDIndicatorView()
ZoneHUD.hud.textLabel.text = text
ZoneHUD.hud.show(in: parentView, animated: true)
}
public class func showSuccessHUD(successText text:String = "success",_ afterDelay:Double = 0.5){
hud.textLabel.text = text
hud.layoutChangeAnimationDuration = 0.3
hud.indicatorView = JGProgressHUDSuccessIndicatorView()
Timer.after(afterDelay) {
//perationQueue.main.addOperation {
hud.dismiss()
//}
}
}
public class func showErrorHUD(errorText text:String = "error",_ afterDelay:Double = 0.5){
hud.textLabel.text = text
hud.layoutChangeAnimationDuration = 0.3
hud.indicatorView = JGProgressHUDErrorIndicatorView()
Timer.after(afterDelay) {
//DispatchQueue.main.async {
ZoneHUD.hud.dismiss()
//}
}
}
public class func dismissNormalHUD(){
hud.dismiss()
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/java8dj/O2OA.git
git@gitee.com:java8dj/O2OA.git
java8dj
O2OA
O2OA
master

Search