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