Skip to content

fix(mobile): iOS builds on Xcode 27.0 no longer fail on 27.1-only hinge APIs - #18913

Open
JeremiahDJordan wants to merge 1 commit into
pingdotgg:mainfrom
JeremiahDJordan:fix/ios-sdk-gate-hinge
Open

JeremiahDJordan wants to merge 1 commit into
pingdotgg:mainfrom
JeremiahDJordan:fix/ios-sdk-gate-hinge

Conversation

@JeremiahDJordan

Copy link
Copy Markdown

Problem

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 + xcodebuild of the app. The build machine was short on disk space.
  • I didn't run SwiftLint locally. The change is one comment and two #if lines, 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

…ge 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 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Oct 13, 2026
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Oct 13, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 704ddeb

Macroscope'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.

You can add or adjust custom eligibility rules. Learn more.

@juliusmarminge juliusmarminge added the macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews label Oct 13, 2026 — with ChatGPT Codex Connector
@macroscopeapp
macroscopeapp Bot dismissed their stale review October 13, 2026 04:04

Dismissing prior approval to re-evaluate 704ddeb

@coderabbitai

coderabbitai Bot commented Oct 13, 2026

Copy link
Copy Markdown

Review in Change Stack →

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 5070a83 and 704ddeb.

📒 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.swift
Initialization 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 · Passed 4
Passed Passed checks (4 passed)
Check name Status Explanation
Title check Passed 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 Passed 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 Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed 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

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants