@available(iOS, introduced: 2.0, deprecated: 100000, message: "Use a UIScreen instance found through context instead: i.e, view.window.windowScene.screen")
open class var main: UIScreen { get }
The proposed method to access it view.window.windowScene.screen won't work for us since we don't have direct access to a view on this context.
An alternative method to get the screen scale is using UITraitCollection. It will have the correct displayScale as long as we are running in a UIKit app. (This is the method KingFisher uses).
I've also added an alternative ImageProcessingMethod for a custom scale factor, in case the user requested a custom image size independent of screen scale.
With this change, we don't have the build error when building with strict concurrency.
Closes #156
Description
UIScreen.main
has a deprecation warning:The proposed method to access it
view.window.windowScene.screen
won't work for us since we don't have direct access to a view on this context.An alternative method to get the screen scale is using
UITraitCollection
. It will have the correctdisplayScale
as long as we are running in a UIKit app. (This is the method KingFisher uses).I've also added an alternative
ImageProcessingMethod
for a custom scale factor, in case the user requested a custom image size independent of screen scale.With this change, we don't have the build error when building with strict concurrency.
Testing Steps