Skip to content

Deprecation of UIScreen.main in iOS 16 #493

@amgleitman

Description

@amgleitman

Introduction

As seen here, the class property UIScreen.main is being deprecated in iOS 16.

Details

We use this API in several places throughout React Native, and with added support for external monitors in iPadOS 16, we should consider migrating away from it. (Or at the very least, we should be aware of how this API behaves when external monitors are involved.)

As of right now, I don't know if there are any existing problems with multiple screens, although it may not necessarily be anything new thanks to existing split-screen functionality on current versions of iPadOS.

Discussion points

Apple recommends using the relevant UIWindowScene instance's screen property as a better way to get the current screen in its documentation. This solution requires iOS 13 or later, although we should probably still be able to use our current implementation as a fallback on older versions (since the current minimum is iOS 12.4, unless there are any plans to change this soon).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions