From 704ddeb8580fdd63ad3deaf1106d5785a8c3bafc Mon Sep 17 00:00:00 2001 From: Jeremiah Jordan Date: Mon, 12 Oct 2026 23:01:51 -0500 Subject: [PATCH] fix(mobile): iOS builds on Xcode 27.0 no longer fail on 27.1-only hinge APIs T3LayoutMetricsView gated the iOS 27.1 hinge, vertical-bar-edge and reserved-region APIs on `#if compiler(>=6.4)`. Xcode 27.0 ships Swift 6.4 with only the iOS 27.0 SDK, so the check passed and device and simulator builds failed with "cannot find 'UIHingeInteraction' in scope". Gate on the SDK instead: `canImport(UIKit, _version: 9127.0.85)` is true only for the UIKit that ships in the iOS 27.1 SDK. The `#available(iOS 27.1, *)` runtime checks are unchanged. Co-Authored-By: Claude Opus 5.5 --- .../t3-native-controls/ios/T3LayoutMetricsView.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/mobile/modules/t3-native-controls/ios/T3LayoutMetricsView.swift b/apps/mobile/modules/t3-native-controls/ios/T3LayoutMetricsView.swift index 1cde09d65f61..936efe7676e9 100644 --- a/apps/mobile/modules/t3-native-controls/ios/T3LayoutMetricsView.swift +++ b/apps/mobile/modules/t3-native-controls/ios/T3LayoutMetricsView.swift @@ -14,7 +14,9 @@ final class T3LayoutMetricsView: ExpoView { registerForTraitChanges([UITraitHorizontalSizeClass.self, UITraitVerticalSizeClass.self]) { (view: T3LayoutMetricsView, _: UITraitCollection) in view.publishMetrics() } - #if compiler(>=6.4) + // The hinge and vertical-bar APIs ship in the iOS 27.1 SDK, whose UIKit is 9127.0.85. + // Xcode 27.0 has Swift 6.4 but the 27.0 SDK (UIKit 9127.0.84), so gate on the SDK. + #if canImport(UIKit, _version: 9127.0.85) if #available(iOS 27.1, *) { hasHinge = nil addInteraction(UIHingeInteraction { [weak self] _, update in @@ -67,7 +69,7 @@ final class T3LayoutMetricsView: ExpoView { } var verticalBarEdge = "none" var regions: [[String: Any]] = [] - #if compiler(>=6.4) + #if canImport(UIKit, _version: 9127.0.85) if #available(iOS 27.1, *) { let rtl = effectiveUserInterfaceLayoutDirection == .rightToLeft switch traitCollection.verticalBarEdge {