Skip to content
Source
Sign inSign up
pingdotgg/t3code

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

MergedJeremiahDJordan(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/18913/headmerged by juliusmarminge View on GitHub

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 / SDKcompiler(>=6.4)canImport(UIKit, _version: 9127.0.85)File beforeFile after
Xcode 27.0, iphonesimulator 27.0truefalse5 errors abovetypechecks
Xcode 27.0, iphoneos 27.0truefalse(same SDK APIs)typechecks
Xcode 27.1 RC, iphonesimulator 27.1truetruetypecheckstypechecks, 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

    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    2. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      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](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    3. juliusmarminge added labelsmacroscope-review

    4. 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 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.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 nameStatusExplanation
      Title checkPassedThe title clearly and concisely describes the main fix: preventing Xcode 27.0 builds from compiling against unavailable iOS 27.1 hinge APIs.
      Description checkPassedThe 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 checkPassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes checkPassedCheck 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.
    5. juliusmarminge merged thisffa343b

    6. juliusmarminge closed this

Sign in to join this conversation.