fix(mobile): iOS builds on Xcode 27.0 no longer fail on 27.1-only hinge APIs #18913
main fromrefs/pull/18913/head·merged by juliusmarminge View on GitHubProblem#
On Xcode 27.0 (27A266a), iOS device and simulator builds of the mobile app fail in T3LayoutMetricsView.swift:
error: cannot find 'UIHingeInteraction' in scope
error: type 'UITraitCollection' has no member 'systemTraitsAffectingVerticalBarEdge'
error: value of type 'UITraitCollection' has no member 'verticalBarEdge'
error: type 'UIView' has no member 'ReservedRegion'
error: cannot find 'reservedRegions' in scope
These iOS 27.1 APIs are gated on #if compiler(>=6.4), added in #12648 and extended in #18654. Xcode 27.0 already ships Swift 6.4 but only the iOS 27.0 SDK, which doesn't declare them. So the compiler check passes, but the SDK doesn't have the APIs.
Change#
Both blocks now check the SDK instead of the compiler: #if canImport(UIKit, _version: 9127.0.85). The UIKit Swift module's -user-module-version is 9127.0.84.1.116 in the iOS 27.0 SDK and 9127.0.85.32.903 in the iOS 27.1 SDK (Xcode 27.1 RC). The UIKit.tbd current-version shows the same bump, from 9127.0.84 to 9127.0.85. The hinge headers (UIHingeInteraction.h, UIVerticalBarEdge.h) exist only in the 27.1 SDK. The #available(iOS 27.1, *) runtime checks are unchanged. When built with Xcode 27.1, the app compiles and behaves exactly as before. When built with Xcode 27.0, these blocks are compiled out, which is what happened on Xcode 26 and earlier.
Scope and approval#
This is a small, focused fix for an obvious build break. It's one file and two preprocessor conditions, with no change to product behavior. Anyone building the iOS app with Xcode 27.0 hits it, so I didn't open an issue first.
Verification#
On macOS 27 with Xcode 27.0 (27A266a, Swift 6.4, iOS SDK 27.0) and Xcode 27.1 RC (iOS SDK 27.1), I typechecked the real T3LayoutMetricsView.swift with swiftc -typecheck for arm64-apple-ios18.0(-simulator). I used small stubs for the Expo types (ExpoView, EventDispatcher, AppContext) and T3WorkspaceOrientationSubscriber, and a probe file that prints which branch each condition takes:
| Toolchain / SDK | compiler(>=6.4) | canImport(UIKit, _version: 9127.0.85) | File before | File after |
|---|---|---|---|---|
| Xcode 27.0, iphonesimulator 27.0 | true | false | 5 errors above | typechecks |
| Xcode 27.0, iphoneos 27.0 | true | false | (same SDK APIs) | typechecks |
| Xcode 27.1 RC, iphonesimulator 27.1 | true | true | typechecks | typechecks, hinge code compiled in |
What I couldn't check:
- I didn't do a full
expo prebuild+xcodebuildof the app. The build machine was short on disk space. - I didn't run SwiftLint locally. The change is one comment and two
#iflines, and CI's native lint covers it. - I didn't check runtime hinge behavior on a Duo simulator. The 27.1 build path is unchanged.
Model and harness: Claude Opus 5.5 in Claude Code.
🤖 Generated with Claude Code
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XS
Approvability#
Verdict: Approved at
704ddebMacroscope's review found this PR approvable — This is a minimal one-file build compatibility fix that gates iOS 27.1 APIs on SDK availability rather than Swift compiler version. Existing supported builds retain their behavior, while Xcode 27.0 builds avoid compiling unavailable APIs.
Notes:
- Diff unchanged. Approvability was decided on eligibility alone.
juliusmarminge added labelsmacroscope-review
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
-
⚙️ Run configuration
-
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Advanced
- Run ID:
0c32c185-cf15-4c90-9c72-d5fc31ab4a80
📥 Commits
-
Reviewing files that changed from the base of the PR and between 5070a83a3248c537d3baaf063e719f179c49bb52 and 704ddeb8580fdd63ad3deaf1106d5785a8c3bafc.
📒 Files selected for processing (1)
-
apps/mobile/modules/t3-native-controls/ios/T3LayoutMetricsView.swift
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
-
📝 Walkthrough
-
The iOS code now gates hinge and vertical-bar APIs on UIKit SDK version 9127.0.85 instead of Swift compiler version 6.4. The existing iOS 27.1 availability checks and their behavior remain unchanged.
Changes: UIKit SDK Availability Gates
Layer / File(s) Summary Update API availability checks
apps/mobile/modules/t3-native-controls/ios/T3LayoutMetricsView.swiftInitialization and metric publication now use the UIKit SDK version 9127.0.85 check for hinge and vertical-bar API code. Priority: ➖ Normal
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers:
juliusmarminge
Merge Risk: ⚪ Minimal · up to
704dd-
The SDK gate preserves compatibility with the earlier SDK while enabling the newer APIs; runtime use remains availability-checked. No merge-blocking risk is identified.
Pre-merge checks ·
4-
Passed checks (4 passed)-
Check name Status Explanation Title check The title clearly and concisely describes the main fix: preventing Xcode 27.0 builds from compiling against unavailable iOS 27.1 hinge APIs. Description check The description covers the problem, technical change, scope justification, verification results, limitations, and agent disclosure. It matches the required template and provides sufficient detail. Linked Issues check Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Check skipped because no linked issues were found for this pull request.
-
✨ Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
-
coderabbitai[bot](GitHub profile, opens in a new tab) approved these changes
juliusmarminge merged thisffa343b
juliusmarminge closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) reviewed