Skip to content

Commit

Permalink
Use trait collection to make it work for other platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
onevcat committed Oct 27, 2023
1 parent 4a851c4 commit f4f91a6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Sources/Views/AnimatedImageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit f4f91a6

Please sign in to comment.