Просмотр исходного кода

Fixed iOS 15 availability check

https://developer.apple.com/documentation/xcode-release-notes/xcode-13-release-notes

From Xcode 13 change log;

Availability checks in iPhone and iPad apps on a Mac with Apple silicon always return true. This causes iOS apps running in macOS 11 Big Sur to see iOS 15 APIs as available, resulting in crashes. This only affects apps available in the Mac App Store built with the “My Mac (Designed for iPhone)” or “My Mac (Designed for iPad)” run destination. It doesn’t affect Mac Catalyst apps. (83378814)

Workaround: Use the following code to check for iOS 15 availability:
        if #available(iOS 15, *), ProcessInfo.processInfo.operatingSystemVersion.majorVersion >= 15 {
egemen toptaş 4 лет назад
Родитель
Сommit
23a952f2bd
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      Sources/Views/AnimatedImageView.swift

+ 1 - 1
Sources/Views/AnimatedImageView.swift

@@ -230,7 +230,7 @@ open class AnimatedImageView: UIImageView {
         if let currentFrame = animator?.currentFrameImage {
         if let currentFrame = animator?.currentFrameImage {
             layer.contents = currentFrame.cgImage
             layer.contents = currentFrame.cgImage
         } else {
         } else {
-            if #available(iOS 15.0, *) {
+            if #available(iOS 15, *), ProcessInfo.processInfo.operatingSystemVersion.majorVersion >= 15 {
                 super.display(layer)
                 super.display(layer)
             } else {
             } else {
                 layer.contents = image?.cgImage
                 layer.contents = image?.cgImage