Commit 5d1bc5a
committed
Stop SwiftUI-based filters from insetting content by the safe area
UIHostingController insets its root view by the safe area, so a filtered view
had its content moved down and shrunk whenever the view overlapped a safe area
edge. A filter must not affect layout.
Set `safeAreaRegions = []` on the hosting controller to opt out, and gate the
SwiftUI filter container at iOS 16.4, the first version where that property
exists. Below 16.4 the filters that need the container stay no-ops, which
matches the behavior before `enableSwiftUIBasedFilters` existed.
`safeAreaRegions` is declared `@available(iOS 16.4, tvOS 16.4, *)`, so both
checks name tvOS. Without the tvOS clause the Swift file fails to build for
tvOS.1 parent d9ad3f0 commit 5d1bc5a
2 files changed
Lines changed: 15 additions & 3 deletions
File tree
- packages/react-native
- ReactApple/RCTSwiftUI
- React/Fabric/Mounting/ComponentViews/View
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1746 | 1746 | | |
1747 | 1747 | | |
1748 | 1748 | | |
1749 | | - | |
| 1749 | + | |
| 1750 | + | |
| 1751 | + | |
| 1752 | + | |
| 1753 | + | |
| 1754 | + | |
| 1755 | + | |
1750 | 1756 | | |
1751 | 1757 | | |
1752 | 1758 | | |
| |||
1755 | 1761 | | |
1756 | 1762 | | |
1757 | 1763 | | |
| 1764 | + | |
1758 | 1765 | | |
1759 | 1766 | | |
1760 | 1767 | | |
| |||
Lines changed: 7 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
19 | 24 | | |
20 | 25 | | |
21 | 26 | | |
| |||
0 commit comments