|
@@ -62,6 +62,9 @@ public class PQLoadingHUBView: UIView {
|
|
|
|
|
|
/// 开始加载
|
|
/// 开始加载
|
|
public func loading() {
|
|
public func loading() {
|
|
|
|
+ if loadingImage.superview == nil {
|
|
|
|
+ addSubview(loadingImage)
|
|
|
|
+ }
|
|
loadingImage.displayGIF(data: nil, images: gifImages, repeatCount: .max, duration: duration ?? 2)
|
|
loadingImage.displayGIF(data: nil, images: gifImages, repeatCount: .max, duration: duration ?? 2)
|
|
}
|
|
}
|
|
|
|
|
|
@@ -130,6 +133,13 @@ public class PQLoadingHUB: NSObject {
|
|
superView.addSubview(loadingHUB)
|
|
superView.addSubview(loadingHUB)
|
|
loadingHUB.loading()
|
|
loadingHUB.loading()
|
|
self?.isLoading = true
|
|
self?.isLoading = true
|
|
|
|
+ } else if superView.viewWithTag(self!.viewTag) != nil {
|
|
|
|
+ if superView.viewWithTag(self!.viewTag)?.superview == nil {
|
|
|
|
+ superView.addSubview(superView.viewWithTag(self!.viewTag)!)
|
|
|
|
+ } else {
|
|
|
|
+ superView.bringSubviewToFront(superView.viewWithTag(self!.viewTag)!)
|
|
|
|
+ }
|
|
|
|
+ (superView.viewWithTag(self!.viewTag) as? PQLoadingHUBView)?.loading()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|