Skip to content

Docs are inaccurate about what could happen if API changes. App will crash instead. #11

@Pranoy1c

Description

@Pranoy1c

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions