From 86070ab07e06fda749b3c00917500fefc7e1ad3d Mon Sep 17 00:00:00 2001 From: Gabe Corso <7492114+gabecorso@users.noreply.github.com> Date: Wed, 24 Jun 2026 09:51:55 -0400 Subject: [PATCH] fix(iOS): add compile guard iOS 26 SwiftUI symbol MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -iOS-26 SwiftUI symbols are guarded only by runtime @available checks, causing compilation to fail on Xcode < 26 with "cannot find type … in scope". - add #if compiler >=6.2 to fix - pattern mirrored from TabViewProps.swift --- .changeset/fix-compiler-guards-ios26.md | 5 +++++ .../ios/BottomAccessoryProvider.swift | 2 +- .../react-native-bottom-tabs/ios/TabView/NewTabView.swift | 6 +++--- 3 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 .changeset/fix-compiler-guards-ios26.md diff --git a/.changeset/fix-compiler-guards-ios26.md b/.changeset/fix-compiler-guards-ios26.md new file mode 100644 index 00000000..61cdda58 --- /dev/null +++ b/.changeset/fix-compiler-guards-ios26.md @@ -0,0 +1,5 @@ +--- +"react-native-bottom-tabs": patch +--- + +Add `#if compiler(>=6.2)` guards to iOS-26 SwiftUI symbols in BottomAccessoryProvider.swift and NewTabView.swift to fix compilation on Xcode < 26 diff --git a/packages/react-native-bottom-tabs/ios/BottomAccessoryProvider.swift b/packages/react-native-bottom-tabs/ios/BottomAccessoryProvider.swift index cde3224b..e6571f91 100644 --- a/packages/react-native-bottom-tabs/ios/BottomAccessoryProvider.swift +++ b/packages/react-native-bottom-tabs/ios/BottomAccessoryProvider.swift @@ -8,7 +8,7 @@ import SwiftUI self.delegate = delegate } - #if !os(macOS) + #if !os(macOS) && compiler(>=6.2) @available(iOS 26.0, tvOS 26.0, *) public func emitPlacementChanged(_ placement: TabViewBottomAccessoryPlacement?) { var placementValue = "none" diff --git a/packages/react-native-bottom-tabs/ios/TabView/NewTabView.swift b/packages/react-native-bottom-tabs/ios/TabView/NewTabView.swift index 2fdc681c..2f18f210 100644 --- a/packages/react-native-bottom-tabs/ios/TabView/NewTabView.swift +++ b/packages/react-native-bottom-tabs/ios/TabView/NewTabView.swift @@ -79,7 +79,7 @@ struct ConditionalBottomAccessoryModifier: ViewModifier { } func body(content: Content) -> some View { - #if os(macOS) || os(tvOS) + #if os(macOS) || os(tvOS) || !compiler(>=6.2) // tabViewBottomAccessory is not available on macOS content #else @@ -96,7 +96,7 @@ struct ConditionalBottomAccessoryModifier: ViewModifier { @ViewBuilder private func renderBottomAccessoryView() -> some View { - #if !os(macOS) && !os(tvOS) + #if !os(macOS) && !os(tvOS) && compiler(>=6.2) if let bottomAccessoryView { if #available(iOS 26.0, *) { BottomAccessoryRepresentableView(view: bottomAccessoryView) @@ -106,7 +106,7 @@ struct ConditionalBottomAccessoryModifier: ViewModifier { } } -#if !os(macOS) && !os(tvOS) +#if !os(macOS) && !os(tvOS) && compiler(>=6.2) @available(iOS 26.0, tvOS 26.0, *) struct BottomAccessoryRepresentableView: PlatformViewRepresentable { @Environment(\.tabViewBottomAccessoryPlacement) var tabViewBottomAccessoryPlacement