I have a iOS app that uses a library. This library used to have problems when the iOS or iPadOS device or simulator was set to be in Zoom mode in the system settings. The developer of the library has provided a fix, but he has told me that in order to benefit from the fix, I have to use UIScreen nativeScale instead of scale. I tried to solve the problem without affecting the rest of the project code by declaring an extension like this:
extension UIScreen {
open var scale: CGFloat {
get {
return nativeScale
}
}
}
This works, but I would like somehow to make this extension effective only when the device is set to zoom mode. I have found a way to detect that, but now I don't know how to proceed. I am aware that I cannot access the scale property from within its getter, so I was wondering if there is a possible implementation to achieve that. Thanks for your attention.