The ScreenCorners extension says:
The corner radius of the display. Uses a private property of UIScreen, and may report 0 if the API changes.
However, I do not think this is accurate. I don't think it will report 0 if the API changes. Instead, if Apple changes the key name to something other than _displayCornerRadius, then the app will crash with error:
*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIScreen 0x1070047b0> valueForUndefinedKey:]: this class is not key value coding-compliant for the key _displayCornerRadius.'
I guess such risks come with use of private APIs but docs should be clear about it.
The
ScreenCornersextension says:However, I do not think this is accurate. I don't think it will report 0 if the API changes. Instead, if Apple changes the key name to something other than
_displayCornerRadius, then the app will crash with error:I guess such risks come with use of private APIs but docs should be clear about it.