Skip to content

Commit a0ab0f5

Browse files
authored
Merge pull request #275 from hyun99999/master
Replace `UIScreen.main` to get display scale on iOS 13.0 and later
2 parents c71a27b + d103ba2 commit a0ab0f5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Sources/Impl/Coordinates.swift

+4
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,11 @@ final class Coordinates<PinView: Layoutable> {
108108

109109
private func getDisplayScale() -> CGFloat {
110110
#if os(iOS) || os(tvOS)
111+
if #available(iOS 13.0, tvOS 13.0, *) {
112+
return UITraitCollection.current.displayScale
113+
} else {
111114
return UIScreen.main.scale
115+
}
112116
#elseif os(OSX)
113117
#if swift(>=4.1)
114118
return NSScreen.main?.backingScaleFactor ?? 2.0

0 commit comments

Comments
 (0)