-
Notifications
You must be signed in to change notification settings - Fork 25k
feat(iOS): remove usages of UIScreen mainScreen for Trait collections #41214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
okwasniewski
wants to merge
2
commits into
facebook:main
from
okwasniewski:okwasniewski/displayScale
Closed
feat(iOS): remove usages of UIScreen mainScreen for Trait collections #41214
okwasniewski
wants to merge
2
commits into
facebook:main
from
okwasniewski:okwasniewski/displayScale
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Base commit: 3648886 |
javache
reviewed
Oct 27, 2023
packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm
Outdated
Show resolved
Hide resolved
javache
approved these changes
Oct 27, 2023
Contributor
|
@javache has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Contributor
|
@javache was there an issue during the Phabricator import? |
|
This pull request was successfully merged by @okwasniewski in ace81ff. When will my fix make it into a release? | Upcoming Releases |
Othinn
pushed a commit
to Othinn/react-native
that referenced
this pull request
Jan 9, 2024
…facebook#41214) Summary: The goal of this PR is to migrate from deprecated `[UIScreen mainScreen]` and get the `displayScale` from currentTraitCollection. Both of those return the same values. ## Changelog: [IOS] [CHANGED] - retrieve screen scale from trait collection instead of UIScreen mainScreen Pull Request resolved: facebook#41214 Test Plan: Go to Dimensions example and check that everything works as expected ### Before <img src="https://github.com/facebook/react-native/assets/52801365/53141e67-63e2-4c3b-818e-6a232aae8a5b" height="500" /> ### After <img src="https://github.com/facebook/react-native/assets/52801365/33728fce-0298-459c-b63e-a0b8ea34bde1" height="500" /> Reviewed By: NickGerleman Differential Revision: D50736794 Pulled By: javache fbshipit-source-id: d512cba1120204be95caf43ac9916f6597e2ccc8
Saadnajmi
pushed a commit
to Saadnajmi/react-native-macos
that referenced
this pull request
Jan 10, 2024
…facebook#41214) Summary: The goal of this PR is to migrate from deprecated `[UIScreen mainScreen]` and get the `displayScale` from currentTraitCollection. Both of those return the same values. [IOS] [CHANGED] - retrieve screen scale from trait collection instead of UIScreen mainScreen Pull Request resolved: facebook#41214 Test Plan: Go to Dimensions example and check that everything works as expected <img src="https://github.com/facebook/react-native/assets/52801365/53141e67-63e2-4c3b-818e-6a232aae8a5b" height="500" /> <img src="https://github.com/facebook/react-native/assets/52801365/33728fce-0298-459c-b63e-a0b8ea34bde1" height="500" /> Reviewed By: NickGerleman Differential Revision: D50736794 Pulled By: javache fbshipit-source-id: d512cba1120204be95caf43ac9916f6597e2ccc8
Saadnajmi
pushed a commit
to Saadnajmi/react-native-macos
that referenced
this pull request
Jan 14, 2024
…facebook#41214) Summary: The goal of this PR is to migrate from deprecated `[UIScreen mainScreen]` and get the `displayScale` from currentTraitCollection. Both of those return the same values. [IOS] [CHANGED] - retrieve screen scale from trait collection instead of UIScreen mainScreen Pull Request resolved: facebook#41214 Test Plan: Go to Dimensions example and check that everything works as expected <img src="https://github.com/facebook/react-native/assets/52801365/53141e67-63e2-4c3b-818e-6a232aae8a5b" height="500" /> <img src="https://github.com/facebook/react-native/assets/52801365/33728fce-0298-459c-b63e-a0b8ea34bde1" height="500" /> Reviewed By: NickGerleman Differential Revision: D50736794 Pulled By: javache fbshipit-source-id: d512cba1120204be95caf43ac9916f6597e2ccc8
Saadnajmi
pushed a commit
to Saadnajmi/react-native-macos
that referenced
this pull request
Jan 15, 2024
…facebook#41214) Summary: The goal of this PR is to migrate from deprecated `[UIScreen mainScreen]` and get the `displayScale` from currentTraitCollection. Both of those return the same values. [IOS] [CHANGED] - retrieve screen scale from trait collection instead of UIScreen mainScreen Pull Request resolved: facebook#41214 Test Plan: Go to Dimensions example and check that everything works as expected <img src="https://github.com/facebook/react-native/assets/52801365/53141e67-63e2-4c3b-818e-6a232aae8a5b" height="500" /> <img src="https://github.com/facebook/react-native/assets/52801365/33728fce-0298-459c-b63e-a0b8ea34bde1" height="500" /> Reviewed By: NickGerleman Differential Revision: D50736794 Pulled By: javache fbshipit-source-id: d512cba1120204be95caf43ac9916f6597e2ccc8
Saadnajmi
pushed a commit
to Saadnajmi/react-native-macos
that referenced
this pull request
Jan 15, 2024
…facebook#41214) Summary: The goal of this PR is to migrate from deprecated `[UIScreen mainScreen]` and get the `displayScale` from currentTraitCollection. Both of those return the same values. [IOS] [CHANGED] - retrieve screen scale from trait collection instead of UIScreen mainScreen Pull Request resolved: facebook#41214 Test Plan: Go to Dimensions example and check that everything works as expected <img src="https://github.com/facebook/react-native/assets/52801365/53141e67-63e2-4c3b-818e-6a232aae8a5b" height="500" /> <img src="https://github.com/facebook/react-native/assets/52801365/33728fce-0298-459c-b63e-a0b8ea34bde1" height="500" /> Reviewed By: NickGerleman Differential Revision: D50736794 Pulled By: javache fbshipit-source-id: d512cba1120204be95caf43ac9916f6597e2ccc8
Saadnajmi
pushed a commit
to Saadnajmi/react-native-macos
that referenced
this pull request
Jan 15, 2024
…facebook#41214) Summary: The goal of this PR is to migrate from deprecated `[UIScreen mainScreen]` and get the `displayScale` from currentTraitCollection. Both of those return the same values. [IOS] [CHANGED] - retrieve screen scale from trait collection instead of UIScreen mainScreen Pull Request resolved: facebook#41214 Test Plan: Go to Dimensions example and check that everything works as expected <img src="https://github.com/facebook/react-native/assets/52801365/53141e67-63e2-4c3b-818e-6a232aae8a5b" height="500" /> <img src="https://github.com/facebook/react-native/assets/52801365/33728fce-0298-459c-b63e-a0b8ea34bde1" height="500" /> Reviewed By: NickGerleman Differential Revision: D50736794 Pulled By: javache fbshipit-source-id: d512cba1120204be95caf43ac9916f6597e2ccc8
Saadnajmi
pushed a commit
to Saadnajmi/react-native-macos
that referenced
this pull request
Jan 15, 2024
…facebook#41214) Summary: The goal of this PR is to migrate from deprecated `[UIScreen mainScreen]` and get the `displayScale` from currentTraitCollection. Both of those return the same values. [IOS] [CHANGED] - retrieve screen scale from trait collection instead of UIScreen mainScreen Pull Request resolved: facebook#41214 Test Plan: Go to Dimensions example and check that everything works as expected <img src="https://github.com/facebook/react-native/assets/52801365/53141e67-63e2-4c3b-818e-6a232aae8a5b" height="500" /> <img src="https://github.com/facebook/react-native/assets/52801365/33728fce-0298-459c-b63e-a0b8ea34bde1" height="500" /> Reviewed By: NickGerleman Differential Revision: D50736794 Pulled By: javache fbshipit-source-id: d512cba1120204be95caf43ac9916f6597e2ccc8
Saadnajmi
pushed a commit
to Saadnajmi/react-native-macos
that referenced
this pull request
Jan 15, 2024
…facebook#41214) Summary: The goal of this PR is to migrate from deprecated `[UIScreen mainScreen]` and get the `displayScale` from currentTraitCollection. Both of those return the same values. [IOS] [CHANGED] - retrieve screen scale from trait collection instead of UIScreen mainScreen Pull Request resolved: facebook#41214 Test Plan: Go to Dimensions example and check that everything works as expected <img src="https://github.com/facebook/react-native/assets/52801365/53141e67-63e2-4c3b-818e-6a232aae8a5b" height="500" /> <img src="https://github.com/facebook/react-native/assets/52801365/33728fce-0298-459c-b63e-a0b8ea34bde1" height="500" /> Reviewed By: NickGerleman Differential Revision: D50736794 Pulled By: javache fbshipit-source-id: d512cba1120204be95caf43ac9916f6597e2ccc8
Saadnajmi
pushed a commit
to Saadnajmi/react-native-macos
that referenced
this pull request
Jan 15, 2024
…facebook#41214) Summary: The goal of this PR is to migrate from deprecated `[UIScreen mainScreen]` and get the `displayScale` from currentTraitCollection. Both of those return the same values. [IOS] [CHANGED] - retrieve screen scale from trait collection instead of UIScreen mainScreen Pull Request resolved: facebook#41214 Test Plan: Go to Dimensions example and check that everything works as expected <img src="https://github.com/facebook/react-native/assets/52801365/53141e67-63e2-4c3b-818e-6a232aae8a5b" height="500" /> <img src="https://github.com/facebook/react-native/assets/52801365/33728fce-0298-459c-b63e-a0b8ea34bde1" height="500" /> Reviewed By: NickGerleman Differential Revision: D50736794 Pulled By: javache fbshipit-source-id: d512cba1120204be95caf43ac9916f6597e2ccc8
Saadnajmi
pushed a commit
to Saadnajmi/react-native-macos
that referenced
this pull request
Jan 15, 2024
…facebook#41214) Summary: The goal of this PR is to migrate from deprecated `[UIScreen mainScreen]` and get the `displayScale` from currentTraitCollection. Both of those return the same values. [IOS] [CHANGED] - retrieve screen scale from trait collection instead of UIScreen mainScreen Pull Request resolved: facebook#41214 Test Plan: Go to Dimensions example and check that everything works as expected <img src="https://github.com/facebook/react-native/assets/52801365/53141e67-63e2-4c3b-818e-6a232aae8a5b" height="500" /> <img src="https://github.com/facebook/react-native/assets/52801365/33728fce-0298-459c-b63e-a0b8ea34bde1" height="500" /> Reviewed By: NickGerleman Differential Revision: D50736794 Pulled By: javache fbshipit-source-id: d512cba1120204be95caf43ac9916f6597e2ccc8
okwasniewski
added a commit
to callstack/react-native-visionos
that referenced
this pull request
Jan 31, 2024
…facebook#41214) Summary: The goal of this PR is to migrate from deprecated `[UIScreen mainScreen]` and get the `displayScale` from currentTraitCollection. Both of those return the same values. ## Changelog: [IOS] [CHANGED] - retrieve screen scale from trait collection instead of UIScreen mainScreen Pull Request resolved: facebook#41214 Test Plan: Go to Dimensions example and check that everything works as expected ### Before <img src="https://github.com/facebook/react-native/assets/52801365/53141e67-63e2-4c3b-818e-6a232aae8a5b" height="500" /> ### After <img src="https://github.com/facebook/react-native/assets/52801365/33728fce-0298-459c-b63e-a0b8ea34bde1" height="500" /> Reviewed By: NickGerleman Differential Revision: D50736794 Pulled By: javache fbshipit-source-id: d512cba1120204be95caf43ac9916f6597e2ccc8
okwasniewski
added a commit
to callstack/react-native-visionos
that referenced
this pull request
Feb 6, 2024
…facebook#41214) Summary: The goal of this PR is to migrate from deprecated `[UIScreen mainScreen]` and get the `displayScale` from currentTraitCollection. Both of those return the same values. ## Changelog: [IOS] [CHANGED] - retrieve screen scale from trait collection instead of UIScreen mainScreen Pull Request resolved: facebook#41214 Test Plan: Go to Dimensions example and check that everything works as expected ### Before <img src="https://github.com/facebook/react-native/assets/52801365/53141e67-63e2-4c3b-818e-6a232aae8a5b" height="500" /> ### After <img src="https://github.com/facebook/react-native/assets/52801365/33728fce-0298-459c-b63e-a0b8ea34bde1" height="500" /> Reviewed By: NickGerleman Differential Revision: D50736794 Pulled By: javache fbshipit-source-id: d512cba1120204be95caf43ac9916f6597e2ccc8
okwasniewski
added a commit
to callstack/react-native-visionos
that referenced
this pull request
Apr 5, 2024
…facebook#41214) Summary: The goal of this PR is to migrate from deprecated `[UIScreen mainScreen]` and get the `displayScale` from currentTraitCollection. Both of those return the same values. ## Changelog: [IOS] [CHANGED] - retrieve screen scale from trait collection instead of UIScreen mainScreen Pull Request resolved: facebook#41214 Test Plan: Go to Dimensions example and check that everything works as expected ### Before <img src="https://github.com/facebook/react-native/assets/52801365/53141e67-63e2-4c3b-818e-6a232aae8a5b" height="500" /> ### After <img src="https://github.com/facebook/react-native/assets/52801365/33728fce-0298-459c-b63e-a0b8ea34bde1" height="500" /> Reviewed By: NickGerleman Differential Revision: D50736794 Pulled By: javache fbshipit-source-id: d512cba1120204be95caf43ac9916f6597e2ccc8
okwasniewski
added a commit
to callstack/react-native-visionos
that referenced
this pull request
Jun 24, 2024
…facebook#41214) Summary: The goal of this PR is to migrate from deprecated `[UIScreen mainScreen]` and get the `displayScale` from currentTraitCollection. Both of those return the same values. ## Changelog: [IOS] [CHANGED] - retrieve screen scale from trait collection instead of UIScreen mainScreen Pull Request resolved: facebook#41214 Test Plan: Go to Dimensions example and check that everything works as expected ### Before <img src="https://github.com/facebook/react-native/assets/52801365/53141e67-63e2-4c3b-818e-6a232aae8a5b" height="500" /> ### After <img src="https://github.com/facebook/react-native/assets/52801365/33728fce-0298-459c-b63e-a0b8ea34bde1" height="500" /> Reviewed By: NickGerleman Differential Revision: D50736794 Pulled By: javache fbshipit-source-id: d512cba1120204be95caf43ac9916f6597e2ccc8
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Merged
This PR has been merged.
Shared with Meta
Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
The goal of this PR is to migrate from deprecated
[UIScreen mainScreen]and get thedisplayScalefrom currentTraitCollection. Both of those return the same values.Changelog:
[IOS] [CHANGED] - retrieve screen scale from trait collection instead of UIScreen mainScreen
Test Plan:
Go to Dimensions example and check that everything works as expected
Before
After