update
This commit is contained in:
@@ -6,14 +6,29 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
//import DDCategoryKit_Private
|
||||
//import YYImage
|
||||
//import SnapKit
|
||||
|
||||
extension UIView {
|
||||
public func dd_showHUD() {
|
||||
let hud = MBProgressHUD.showAdded(to: self, animated: true)
|
||||
hud.bezelView.color = UIColor.black
|
||||
hud.bezelView.style = .solidColor
|
||||
hud.contentColor = UIColor.white
|
||||
hud.show(animated: true)
|
||||
let viewHud = MBProgressHUD.forView(self)
|
||||
|
||||
if viewHud == nil {
|
||||
let hud = MBProgressHUD.showAdded(to: self, animated: true)
|
||||
hud.bezelView.color = UIColor.white
|
||||
hud.bezelView.style = .solidColor
|
||||
hud.contentColor = UIColor.black
|
||||
hud.show(animated: true)
|
||||
}
|
||||
|
||||
// if viewHud == nil {
|
||||
// let hud = MBProgressHUD.showAdded(to: self, animated: true)
|
||||
// hud.mode = MBProgressHUDMode.customView
|
||||
// hud.customView = HudCustomView.init()
|
||||
// hud.minSize = CGSize(width: 60, height: 60)
|
||||
// hud.show(animated: true)
|
||||
// }
|
||||
}
|
||||
|
||||
public func dd_hideHUD() {
|
||||
@@ -21,3 +36,21 @@ extension UIView {
|
||||
hud?.hide(animated: true)
|
||||
}
|
||||
}
|
||||
|
||||
//class HudCustomView : UIView {
|
||||
// override init(frame: CGRect) {
|
||||
// super.init(frame: frame)
|
||||
// let data = UIImage.dd_imageGifNamed("networking_loading", bundleName: "ProgressHud", aClass: HudCustomView.self)
|
||||
// let animatedImageView = YYAnimatedImageView.init(image: YYImage.init(data: data ?? Data.init(),scale: 1))
|
||||
// addSubview(animatedImageView)
|
||||
// animatedImageView.snp.makeConstraints { make in
|
||||
// make.width.height.equalTo(60)
|
||||
// make.center.equalToSuperview()
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// required init?(coder: NSCoder) {
|
||||
// fatalError("init(coder:) has not been implemented")
|
||||
// }
|
||||
//
|
||||
//}
|
||||
|
||||
Reference in New Issue
Block a user