Skip to content

Commit d103ba2

Browse files
committed
Use UITraitCollection to access display scale
1 parent b2ff6d5 commit d103ba2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Sources/Impl/Coordinates.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,7 @@ final class Coordinates<PinView: Layoutable> {
109109
private func getDisplayScale() -> CGFloat {
110110
#if os(iOS) || os(tvOS)
111111
if #available(iOS 13.0, tvOS 13.0, *) {
112-
let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene
113-
return windowScene?.screen.scale ?? 1.0
112+
return UITraitCollection.current.displayScale
114113
} else {
115114
return UIScreen.main.scale
116115
}

0 commit comments

Comments
 (0)