From b3b1e671ce6d877825204869d39f41e389146b19 Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Fri, 30 Oct 2026 17:29:17 -0700 Subject: [PATCH] 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 --- .../React/CoreModules/RCTAccessibilityManager.mm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/react-native/React/CoreModules/RCTAccessibilityManager.mm b/packages/react-native/React/CoreModules/RCTAccessibilityManager.mm index dee5e643c758..e3999e50f0ac 100644 --- a/packages/react-native/React/CoreModules/RCTAccessibilityManager.mm +++ b/packages/react-native/React/CoreModules/RCTAccessibilityManager.mm @@ -29,12 +29,15 @@ @interface RCTAccessibilityManager () @end // Show Borders was called Button Shapes before iOS 26.1, where UIKit deprecated -// its API in favor of the Accessibility framework. +// its API in favor of the Accessibility framework. Early iOS 26.1 betas can lack +// the new symbols even though they pass the version availability check. static BOOL RCTIsShowBordersEnabled() { #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 260100 if (@available(iOS 26.1, *)) { - return AXShowBordersEnabled(); + if (AXShowBordersEnabled != nullptr && &AXShowBordersEnabledStatusDidChangeNotification != nullptr) { + return AXShowBordersEnabled(); + } } #endif #pragma clang diagnostic push @@ -47,7 +50,9 @@ static NSNotificationName RCTShowBordersStatusDidChangeNotification() { #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 260100 if (@available(iOS 26.1, *)) { - return AXShowBordersEnabledStatusDidChangeNotification; + if (AXShowBordersEnabled != nullptr && &AXShowBordersEnabledStatusDidChangeNotification != nullptr) { + return AXShowBordersEnabledStatusDidChangeNotification; + } } #endif #pragma clang diagnostic push