Repository navigation
Fix the iOS build on Xcode 27.0 (pager fold split from #217) - #222
Merged
Merged
Conversation
#217 calls GeometryProxy.reservedRegions, which only exists in the iOS 27.1 SDK. #available is a run time check, so Xcode 27.0 still fails to compile the call, and the ternary after it then fails to type-check. That broke mobile-air's iOS Build on Xcode 27.0. The call now sits behind canImport(SwiftUICore, _version: 8.0.85). Xcode 27.0 and 27.1 both ship Swift 6.4, so a compiler check can't tell them apart, but SwiftUICore is 8.0.84 in iOS 27.0 and 8.0.85 in 27.1. On 27.0 the pager splits evenly, as it does on any phone without a fold. The fold lookup moves into a helper with explicit types and the ternary becomes an if/else. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
mobile-air's "iOS Build - Xcode 27.0" check has failed on main and on every PR since #217 landed. The build stops in
NativeUIPagerRenderer.swift:GeometryProxy.reservedRegionsis new in the iOS 27.1 SDK. The#available(iOS 27.1, *)guard only works at run time, so Xcode 27.0 still can't compile the call. The second error is a knock-on from the first.This puts the fold lookup behind
#if canImport(SwiftUICore, _version: 8.0.85). A#if compiler(...)check won't work here because Xcode 27.0 and 27.1 both ship Swift 6.4. The SDK's SwiftUICore version does differ: the iOS 27.0 simulator runtime has 8.0.84, 27.1 has 8.0.85, and the 27.2 SDK has 8.1.13. Built with Xcode 27.0, the pager splits evenly, the same as on any phone without a fold. Built with 27.1 or later, nothing changes.I also moved the lookup into a small helper with explicit types and turned the ternary into an if/else, so it can't run into the type-checker limit again.
The cut-off is confirmed on the real SDKs. A throwaway mobile-air PR (NativePHP/mobile-air#725) ran its iOS Build against this branch on both Xcodes and printed each SDK's SwiftUICore version:
mobile-air's own iOS Build checks out mobile-ui main, so it goes green once this is merged.
Also tested locally with Xcode 27.2 (Swift 6.4.2): a
swiftc -typecheck -wmoof mobile-air main's app Swift plus this repo'sresources/iosshows the same baseline errors as main and none in the pager. I planted a canary error inside the gated block. It fired with the gate as written and didn't fire with the gate forced off, which stands in for the 27.0 SDK.I also ran mobile-air's iOS Build steps locally on Xcode 27.2 against this branch and mobile-air main:
native:install ios,native:build --simulated, then the Release device build withxcodebuild. Both builds succeeded.🤖 Generated with Claude Code