Skip to content

Commit 70d9b56

Browse files
Saadnajmifacebook-github-bot
authored andcommitted
Fix Catalyst @availablity checks in RCTPullToRefreshViewComponentView.mm (#35673)
Summary: Judging from the original [commit](4c4948b), the availability check is probably for Catalyst, not macOS. That matches the [apple documentation](https://developer.apple.com/documentation/uikit/uiscrollview/2127691-refreshcontrol?language=objc) as well (though we need 13.1, not 13). To avoid needing to introduce a diff in React Native macOS (where we actually compile for macOS and not Mac Catalyst) let's fix the availability check to be more accurate. Changing `macOS` to `MacCatalyst` should be supported as per https://docs.swift.org/swift-book/ReferenceManual/Attributes.html#ID348 (2c5a966) ## Changelog [IOS] [FIXED] - Fixed Mac Catalyst availability checks Pull Request resolved: #35673 Test Plan: Code compiles Reviewed By: christophpurrer Differential Revision: D42149589 Pulled By: cipolleschi fbshipit-source-id: fbbd31cba44f55215f2c4c0f37aad410d5bcd627
1 parent 29a0791 commit 70d9b56

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm

+2-2
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ - (void)_attach
132132
return;
133133
}
134134

135-
if (@available(macOS 13.0, *)) {
135+
if (@available(macCatalyst 13.1, *)) {
136136
_scrollViewComponentView.scrollView.refreshControl = _refreshControl;
137137
}
138138
}
@@ -146,7 +146,7 @@ - (void)_detach
146146
// iOS requires to end refreshing before unmounting.
147147
[_refreshControl endRefreshing];
148148

149-
if (@available(macOS 13.0, *)) {
149+
if (@available(macCatalyst 13.1, *)) {
150150
_scrollViewComponentView.scrollView.refreshControl = nil;
151151
}
152152
_scrollViewComponentView = nil;

0 commit comments

Comments
 (0)