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