Skip to content

Commit

Permalink
Prevent a “unrecognized selector sent to instance” crash caused by UI…
Browse files Browse the repository at this point in the history
…Kit incorrectly marking preferredImageDynamicRange available on UIImageView since iOS 2.0
  • Loading branch information
ejensen committed Jun 17, 2024
1 parent 084076d commit 33cbea7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/NukeExtensions/ImageViewExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -413,9 +413,9 @@ extension ImageViewController {
transitionView.frame = imageView.frame
transitionView.tintColor = imageView.tintColor
transitionView.tintAdjustmentMode = imageView.tintAdjustmentMode
#if swift(>=5.9) // preferredImageDynamicRange was back-ported to all iOS/tvOS versions, but only available when using the iOS/tvOS 17+ SDKs
transitionView.preferredImageDynamicRange = imageView.preferredImageDynamicRange
#endif
if #available(iOS 17.0, tvOS 17.0, *) {
transitionView.preferredImageDynamicRange = imageView.preferredImageDynamicRange
}
transitionView.preferredSymbolConfiguration = imageView.preferredSymbolConfiguration
transitionView.isHidden = imageView.isHidden
transitionView.clipsToBounds = imageView.clipsToBounds
Expand Down

0 comments on commit 33cbea7

Please sign in to comment.