This commit is contained in:
DDIsFriend
2023-08-24 16:46:39 +08:00
parent 887a468768
commit 1a0943017a
139 changed files with 24162 additions and 13640 deletions

View File

@@ -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")
// }
//
//}