Commit ace81ff
feat(iOS): remove usages of UIScreen mainScreen for Trait collections (#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: #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: d512cba1120204be95caf43ac9916f6597e2ccc81 parent 817fedb commit ace81ff
4 files changed
Lines changed: 5 additions & 5 deletions
File tree
- packages
- react-native/React
- Base
- Fabric/Mounting/ComponentViews/View
- Views
- rn-tester/RCTTest/FBSnapshotTestCase
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
305 | | - | |
| 305 | + | |
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
309 | 309 | | |
310 | 310 | | |
311 | 311 | | |
312 | | - | |
| 312 | + | |
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
255 | | - | |
| 255 | + | |
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
216 | | - | |
| 216 | + | |
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
0 commit comments