mirror of https://github.com/xaoxuu/ProHUD
代码优化
This commit is contained in:
parent
639dab2db0
commit
6b5b3dc0c9
|
@ -133,7 +133,7 @@ public extension Guard {
|
||||||
return f(vc)
|
return f(vc)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
debug("请传入需要push到的控制器")
|
debug("⚠️自动获取根控制器失败,请设置根控制器或者传入需要push到的控制器")
|
||||||
}
|
}
|
||||||
return self
|
return self
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,20 +9,20 @@
|
||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
@available(iOS 13.0, *)
|
@available(iOS 13.0, *)
|
||||||
public var sharedWindowScene: UIWindowScene?
|
|
||||||
|
fileprivate var sharedWindowScene: UIWindowScene?
|
||||||
|
|
||||||
public extension ProHUD {
|
public extension ProHUD {
|
||||||
struct Configuration {
|
struct Configuration {
|
||||||
|
|
||||||
/// 是否允许Debug模式输出
|
/// 是否允许log输出
|
||||||
public var enableDebugPrint = true
|
public var enablePrint = true
|
||||||
|
|
||||||
/// 根控制器
|
/// 根控制器,默认可以自动获取,如果获取失败请主动设置
|
||||||
public var rootViewController: UIViewController?
|
public var rootViewController: UIViewController?
|
||||||
|
|
||||||
@available(iOS 13.0, *)
|
@available(iOS 13.0, *)
|
||||||
|
/// iOS13必须设置此值,默认可以自动获取,如果获取失败请主动设置
|
||||||
/// Xcode11 创建的基于 windowScene 的应用必须设置此值
|
|
||||||
public var windowScene: UIWindowScene? {
|
public var windowScene: UIWindowScene? {
|
||||||
set {
|
set {
|
||||||
sharedWindowScene = newValue
|
sharedWindowScene = newValue
|
||||||
|
|
|
@ -113,8 +113,8 @@ internal var isPortrait: Bool {
|
||||||
|
|
||||||
/// 可控Debug输出
|
/// 可控Debug输出
|
||||||
internal func debug(_ items: Any..., separator: String = " ", terminator: String = "\n") {
|
internal func debug(_ items: Any..., separator: String = " ", terminator: String = "\n") {
|
||||||
if cfg.enableDebugPrint {
|
if cfg.enablePrint {
|
||||||
debugPrint(items, separator: separator, terminator: terminator)
|
print(items, separator: separator, terminator: terminator)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -257,7 +257,7 @@ public extension Toast {
|
||||||
} else if toasts.count == 1 {
|
} else if toasts.count == 1 {
|
||||||
toasts.removeAll()
|
toasts.removeAll()
|
||||||
} else {
|
} else {
|
||||||
debug("漏洞:已经没有toast了")
|
debug("‼️代码漏洞:已经没有toast了")
|
||||||
}
|
}
|
||||||
UIView.animateForToast(animations: {
|
UIView.animateForToast(animations: {
|
||||||
toast.window?.transform = .init(translationX: 0, y: -20-toast.maxY)
|
toast.window?.transform = .init(translationX: 0, y: -20-toast.maxY)
|
||||||
|
|
Loading…
Reference in New Issue