We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
UITraitCollection.current.displayScale
UIScreen.main.scale
1 parent cdf8499 commit f081afaCopy full SHA for f081afa
Sources/Public/iOS/LottieAnimationViewBase.swift
@@ -39,7 +39,11 @@ open class LottieAnimationViewBase: UIView {
39
40
var screenScale: CGFloat {
41
#if os(iOS) || os(tvOS)
42
- UIScreen.main.scale
+ if #available(iOS 13.0, tvOS 13.0, *) {
43
+ return max(UITraitCollection.current.displayScale, 1)
44
+ } else {
45
+ return UIScreen.main.scale
46
+ }
47
#else // if os(visionOS)
48
// We intentionally don't check `#if os(visionOS)`, because that emits
49
// a warning when building on Xcode 14 and earlier.
@@ -79,6 +83,5 @@ open class LottieAnimationViewBase: UIView {
79
83
func animationWillEnterForeground() {
80
84
// Implemented by subclasses.
81
85
}
82
-
86
87
#endif
0 commit comments