代码优化

This commit is contained in:
xaoxuu 2020-06-19 10:54:55 +08:00
parent 639dab2db0
commit 6b5b3dc0c9
4 changed files with 10 additions and 10 deletions

View File

@ -133,7 +133,7 @@ public extension Guard {
return f(vc) return f(vc)
} }
} }
debug("请传入需要push到的控制器") debug("⚠️自动获取根控制器失败,设置根控制器或者传入需要push到的控制器")
} }
return self return self
} }

View File

@ -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

View File

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

View File

@ -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)