Remove version guards below the Kingfisher 8 baseline - #2571
Merged
onevcat merged 4 commits intoAug 25, 2026
Conversation
The deployment floor of iOS 13 / tvOS 13 / macOS 10.15 / watchOS 6 makes the CryptoKit branch always available, so the availability check is always true and the CC_SHA256 path can never run. Delete the fallback and the CommonCrypto import, which has no other use in the project.
The deployment floor is iOS 13 / tvOS 13 / macOS 10.15 / watchOS 6, declared identically in Package.swift, Kingfisher.podspec and the Xcode project. Availability checks at or below that floor are always true, and their else branches are unreachable. Keep the always-true branches and drop the checks: - Indicator picks the .large / .medium activity indicator styles directly instead of falling back to the removed .white / .gray. - AnimatedImageView reads UITraitCollection.current.displayScale directly, and the scale variable becomes a constant. - KingfisherError.isLowDataModeConstrained and the low data mode request setup in ImageDownloader keep their remaining conditions, only the availability clause is removed.
The Kingfisher 8.0 requirements in the README state Swift 5.9+, so compiler(>=5.1), compiler(>=5.4) and swift(>=5.9) are always true and their else branches never compile. - The UIActivityIndicatorView.Style compatibility extension only declared fallback .large / .medium constants inside the dead else branch, so removing the guard leaves it empty and the whole extension goes away. - CPListItem gets its image set unconditionally. The comment explaining the removed compile check goes with it. - DisplayLink keeps the macOS 14.0 availability check and the CADisplayLink conformances unguarded, and drops the "make old compilers happy" workaround. The compiler(>=5.10) and swift(>=5.10) guards in Image.swift and CallbackQueue.swift stay, as do all compiler(>=6) guards: their else branches still compile under a Swift 5.9 toolchain.
…rgets The tvOS 12.0 annotations on the TVMonogramView support and the iOS 13.0 / tvOS 13.0 annotations on the UIAction and UICommand conformances are at or below the deployment floor, so they no longer restrict anything.
onevclaw
reviewed
Aug 25, 2026
onevclaw
left a comment
Contributor
There was a problem hiding this comment.
I reviewed exact head 854c18b9e55d75a26c9dda739ae3429789dac9fa and found no blocking issues. The removed compiler and availability branches are unreachable under Kingfisher 8’s supported Swift and platform minimums, while the macOS runtime fallback remains intact.
Local validation passed the full test suite, CocoaPods lint across supported platforms, SwiftPM build, visionOS build, and a Catalyst 13.1 type-check probe. I’m leaving this as a non-approving review because the visible CI state is still pending.
onevclaw - an assistant to @onevcat
Owner
|
LGTM! Thank you for it. |
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.
Motivation
Kingfisher 8 requires iOS 13.0+ / tvOS 13.0+ / macOS 10.15+ / watchOS 6.0+ / visionOS 1.0+ and Swift 5.9+. Package.swift, Kingfisher.podspec, and the Xcode project all declare the same deployment targets. A few version checks below this baseline are still in the sources. They always take the same branch, so the other branch is dead code.
Changes
String+SHA256: the CryptoKit path is always available, so the CommonCrypto fallback and its import are removed. CommonCrypto is not used anywhere else.Indicator: picks the.large/.mediumactivity indicator styles directly. TheUIActivityIndicatorView.Stylecompatibility extension only declared fallback constants for compilers older than 5.1, so nothing is left in it and the whole extension is removed.AnimatedImageView: readsUITraitCollection.current.displayScaledirectly instead of falling back toUIScreen.main.scale.KingfisherError.isLowDataModeConstrainedand the low data mode request setup inImageDownloader: only the#availableclause is removed, the remaining conditions stay.CPListItem: every SDK that ships with Swift 5.4+ acceptssetImage(nil), so the image is set unconditionally.DisplayLink: theswift(>=5.9)guards are removed. The#available(macOS 14.0, *)check stays, since that is a real runtime check.@available(tvOS 12.0, *)annotations on theTVMonogramViewsupport and the@available(iOS 13.0, tvOS 13.0, *)annotations on theUIAction/UICommandconformances are at or below the baseline and no longer restrict anything, so they are removed as well.The
compiler(>=5.10),swift(>=5.10), andcompiler(>=6)guards are left untouched. Their else branches still compile on a Swift 5.9 toolchain.No behavior change is intended. The diff is deletions and indentation only.
Tests
No new tests. The full suite passes on iOS and macOS locally, and tvOS / watchOS / visionOS still build.