fix(ios): let pre-Xcode-26 toolchains compile the Liquid Glass surfaces - #364
Draft
simonhamp wants to merge 1 commit into
Draft
fix(ios): let pre-Xcode-26 toolchains compile the Liquid Glass surfaces#364simonhamp wants to merge 1 commit into
simonhamp wants to merge 1 commit into
Conversation
`#available(iOS 26.0, *)` is a runtime gate — the symbol still has to
exist in the SDK being compiled against. Building the renderer with
Xcode 16 (iOS 18 SDK) therefore failed outright:
value of type 'TabBarAccessoryModifier.Content'
has no member 'tabViewBottomAccessory'
Wrap each of the six iOS 26 call sites in a compile-time `#if
compiler(>=6.2)` gate around the existing runtime one. Swift has no
direct SDK-version condition, but the toolchain and SDK ship together
(Xcode 16.x tops out at Swift 6.1.2; Xcode 26 ships 6.2), so the
compiler version stands in for it. The pre-26 branch is factored into a
`fallback` helper at each site so the two `#if` arms can't drift apart.
Nothing about device support changes: the deployment target stays at
iOS 18.2 and the runtime guards are untouched. A binary built with
Xcode 16 simply renders the pre-26 fallbacks everywhere, including on
iOS 26 hardware — `LiquidGlassAvailability.swift` documents the trade-off
and emits a `#warning` so that's visible in the build log.
Co-Authored-By: Claude Opus 5 (1M context) <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.
Fixes the compile failure reported in NativePHP/nativephp.com#450, where a fresh v4 app built with Xcode 16.4 (iOS 18.5 SDK) fails in the native renderer:
Why the existing guards weren't enough
#available(iOS 26.0, *)is a runtime gate — it stops the call on old devices, but the symbol still has to exist in the SDK being compiled against. So the linked PR was right that#availablealone can't save it, but wrong that Xcode 26 is therefore mandatory: each iOS 26 call site just needs a second, compile-time gate wrapped around the runtime one.Swift has no direct "which SDK am I building against?" condition, but the toolchain and the SDK ship together, so the compiler version stands in for it:
#if compiler(>=6.2)therefore reads as "the iOS 26 SDK is present".What changed
tabViewBottomAccessorywas just the first error hit — there were six iOS 26 call sites, all now gated:ContentView.GlassPillBackground—.glassEffect(in:)NodeStyleModifier.GlassModifier—.glassEffect(_:in:)NodeStyleModifier.WithGlassContainer—GlassEffectContainerNativeRootStackRenderer—.safeAreaBar(edge:)NativeRootStackRenderer—.navigationSubtitle(_:)NativeRootTabsRenderer—.tabViewBottomAccessoryEach keeps its
#availablecheck inside the#if, with the pre-26 branch factored into afallbackhelper so the two#ifarms can't drift apart. NewLiquidGlassAvailability.swiftdocuments the rationale in one place and emits a#warningon pre-Xcode-26 toolchains, so it's obvious in the build log that Liquid Glass was compiled out.Device support is unchanged
The iOS 18 side already worked —
IPHONEOS_DEPLOYMENT_TARGETis already18.2and every iOS 26 API was already runtime-guarded, so an iPad stuck on iOS 18 was never the blocked case. The compile was the only failure. Real floor is Xcode 16.2, not 16.0 — 16.0/16.1 ship the iOS 18.0/18.1 SDK, below the 18.2 deployment target.Two things to flag
.navigationSubtitle.Verification
Built both paths with Xcode 26.3 against a clean derived-data dir. Error set is identical to the pre-change baseline (10 pre-existing
php_embederrors — the PHP headers aren't vendored into a bare clone) with no new warnings. Then forced the#elsearm via a temporarycompiler(>=9.9)flip and rebuilt: still no new errors, and the#warningfires as expected. That proves the fallbacks type-check with zero iOS 26 symbols in scope at a 18.2 deployment target.Only Xcode 26.3 was available here, so the flip is a simulation of Xcode 16 rather than the real thing — worth one confirming build on 16.4 before merge.
PHP suite: 854 passed.
🤖 Generated with Claude Code