Skip to content

Commit 704ddeb

Browse files
zansonclaude
andcommitted
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 <[email protected]>
1 parent 5070a83 commit 704ddeb

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎apps/mobile/modules/t3-native-controls/ios/T3LayoutMetricsView.swift‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ final class T3LayoutMetricsView: ExpoView {
1414
registerForTraitChanges([UITraitHorizontalSizeClass.self, UITraitVerticalSizeClass.self]) { (view: T3LayoutMetricsView, _: UITraitCollection) in
1515
view.publishMetrics()
1616
}
17-
#if compiler(>=6.4)
17+
// The hinge and vertical-bar APIs ship in the iOS 27.1 SDK, whose UIKit is 9127.0.85.
18+
// Xcode 27.0 has Swift 6.4 but the 27.0 SDK (UIKit 9127.0.84), so gate on the SDK.
19+
#if canImport(UIKit, _version: 9127.0.85)
1820
if #available(iOS 27.1, *) {
1921
hasHinge = nil
2022
addInteraction(UIHingeInteraction { [weak self] _, update in
@@ -67,7 +69,7 @@ final class T3LayoutMetricsView: ExpoView {
6769
}
6870
var verticalBarEdge = "none"
6971
var regions: [[String: Any]] = []
70-
#if compiler(>=6.4)
72+
#if canImport(UIKit, _version: 9127.0.85)
7173
if #available(iOS 27.1, *) {
7274
let rtl = effectiveUserInterfaceLayoutDirection == .rightToLeft
7375
switch traitCollection.verticalBarEdge {

0 commit comments

Comments
 (0)