2
0
Эх сурвалжийг харах

Use trait collection to make it work for other platforms

onevcat 2 жил өмнө
parent
commit
f4f91a6681

+ 2 - 3
Sources/Views/AnimatedImageView.swift

@@ -270,9 +270,8 @@ open class AnimatedImageView: UIImageView {
             #else
             var scale: CGFloat = 0
             
-            if #available(iOS 13.0, *) {
-                let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene
-                scale = windowScene?.screen.scale ?? 1.0
+            if #available(iOS 13.0, tvOS 13.0, *) {
+                scale = UITraitCollection.current.displayScale
             } else {
                 scale = UIScreen.main.scale
             }