mirror of
https://github.com/fxm90/GradientLoadingBar.git
synced 2026-06-16 12:24:31 +00:00
🚨 :: Fix keyWindow deprecation warning
This commit is contained in:
1 parent
be40ac8c35
commit
03b9fac539
4 files changed
+31
-27
No files matched your search
@@ -8,6 +8,8 @@
|
||||
|
||||
import SnapshotTesting
|
||||
|
||||
@testable import GradientLoadingBar
|
||||
|
||||
// MARK: - Config
|
||||
|
||||
private enum Config {
|
||||
@@ -25,7 +27,7 @@ extension Snapshotting where Value: UIViewController, Format == UIImage {
|
||||
Async<UIImage> { callback in
|
||||
UIView.setAnimationsEnabled(false)
|
||||
|
||||
guard let keyWindow = UIApplication.shared.windows.first(where: { $0.isKeyWindow }) else {
|
||||
guard let keyWindow = UIApplication.shared.keyWindowInConnectedScenes else {
|
||||
fatalError("⚠️ – Failed to get key window from application!")
|
||||
}
|
||||
keyWindow.rootViewController = viewController
|
||||
|
||||
Reference in new issue
Block a user