Skip to content

Commit f9855ad

Browse files
authored
Guard Show Borders accessibility APIs on early iOS 26.1 betas
Summary: Early iOS 26.1 betas can report version 26.1 without providing the new Show Borders accessibility symbols. Check both the query function and notification variable address before using either, falling back to the UIKit Button Shapes APIs when either is absent. This prevents a crash during accessibility module initialisation and keeps the state query paired with its change notification. Changelog: [iOS][Fixed] - Prevent an accessibility module startup crash on early iOS 26.1 betas Differential Revision: D128734438 Pull Request resolved: #59705
1 parent e57dcb3 commit f9855ad

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

‎packages/react-native/React/CoreModules/RCTAccessibilityManager.mm‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,15 @@ @interface RCTAccessibilityManager () <NativeAccessibilityManagerSpec>
2929
@end
3030

3131
// Show Borders was called Button Shapes before iOS 26.1, where UIKit deprecated
32-
// its API in favor of the Accessibility framework.
32+
// its API in favor of the Accessibility framework. Early iOS 26.1 betas can lack
33+
// the new symbols even though they pass the version availability check.
3334
static BOOL RCTIsShowBordersEnabled()
3435
{
3536
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 260100
3637
if (@available(iOS 26.1, *)) {
37-
return AXShowBordersEnabled();
38+
if (AXShowBordersEnabled != nullptr && &AXShowBordersEnabledStatusDidChangeNotification != nullptr) {
39+
return AXShowBordersEnabled();
40+
}
3841
}
3942
#endif
4043
#pragma clang diagnostic push
@@ -47,7 +50,9 @@ static NSNotificationName RCTShowBordersStatusDidChangeNotification()
4750
{
4851
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 260100
4952
if (@available(iOS 26.1, *)) {
50-
return AXShowBordersEnabledStatusDidChangeNotification;
53+
if (AXShowBordersEnabled != nullptr && &AXShowBordersEnabledStatusDidChangeNotification != nullptr) {
54+
return AXShowBordersEnabledStatusDidChangeNotification;
55+
}
5156
}
5257
#endif
5358
#pragma clang diagnostic push

0 commit comments

Comments
 (0)