Guard iOS 26 APIs for compatibility with Xcode 16.x#506
Open
kastwey wants to merge 1 commit intocallstack:mainfrom
Open
Guard iOS 26 APIs for compatibility with Xcode 16.x#506kastwey wants to merge 1 commit intocallstack:mainfrom
kastwey wants to merge 1 commit intocallstack:mainfrom
Conversation
3 tasks
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.
Problem
Builds fail on Xcode 16.x (Swift 5.10) because
TabViewBottomAccessoryPlacement,.tabViewBottomAccessory, and\.tabViewBottomAccessoryPlacementare iOS 26 APIs that the compiler cannot resolve — even inside@available(iOS 26.0, *)blocks. The@availableattribute is a runtime check; the compiler still needs to parse and type-check the code at compile time.PR #486 partially addressed this for macOS with
#if !os(macOS), but the same issue affects iOS when using any Xcode version prior to Xcode 26.Solution
Replace
#if !os(macOS)with#if compiler(>=6.1) && !os(macOS)in bothBottomAccessoryProvider.swiftandNewTabView.swift. Swift 6.1 ships with Xcode 26, so this ensures the iOS 26 API references are only compiled when the toolchain actually supports them.Changes
BottomAccessoryProvider.swift:#if !os(macOS)→#if compiler(>=6.1) && !os(macOS)NewTabView.swift: All#if !os(macOS)and#if os(macOS)guards around iOS 26 code →#if compiler(>=6.1) && !os(macOS)/#elseFixes [IOS] Swift Compilation Error in NewTabView.swift - Generic Parameter Inference Failure #490