From 5f6bc9f47559d03cb5adb0fd8cf534b81df6300d Mon Sep 17 00:00:00 2001 From: Juanjo M Date: Sun, 8 Mar 2026 03:14:29 +0000 Subject: [PATCH] fix(ios): guard iOS 26 APIs with #if compiler(>=6.1) to fix build on Xcode 16.x --- .../ios/BottomAccessoryProvider.swift | 2 +- .../ios/TabView/NewTabView.swift | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/react-native-bottom-tabs/ios/BottomAccessoryProvider.swift b/packages/react-native-bottom-tabs/ios/BottomAccessoryProvider.swift index 539efee..1069443 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 compiler(>=6.1) && !os(macOS) @available(iOS 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 22c52cd..2a8952e 100644 --- a/packages/react-native-bottom-tabs/ios/TabView/NewTabView.swift +++ b/packages/react-native-bottom-tabs/ios/TabView/NewTabView.swift @@ -78,10 +78,7 @@ struct ConditionalBottomAccessoryModifier: ViewModifier { } func body(content: Content) -> some View { - #if os(macOS) - // tabViewBottomAccessory is not available on macOS - content - #else + #if compiler(>=6.1) && !os(macOS) if #available(iOS 26.0, tvOS 26.0, visionOS 3.0, *), bottomAccessoryView != nil { content .tabViewBottomAccessory { @@ -90,12 +87,14 @@ struct ConditionalBottomAccessoryModifier: ViewModifier { } else { content } + #else + content #endif } @ViewBuilder private func renderBottomAccessoryView() -> some View { - #if !os(macOS) + #if compiler(>=6.1) && !os(macOS) if let bottomAccessoryView { if #available(iOS 26.0, *) { BottomAccessoryRepresentableView(view: bottomAccessoryView) @@ -105,7 +104,7 @@ struct ConditionalBottomAccessoryModifier: ViewModifier { } } -#if !os(macOS) +#if compiler(>=6.1) && !os(macOS) @available(iOS 26.0, *) struct BottomAccessoryRepresentableView: PlatformViewRepresentable { @Environment(\.tabViewBottomAccessoryPlacement) var tabViewBottomAccessoryPlacement