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

add all of other supported platform versions to the check

wangwenyu 2 лет назад
Родитель
Сommit
00111d7d39
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      Sources/Utility/Runtime.swift

+ 1 - 1
Sources/Utility/Runtime.swift

@@ -27,7 +27,7 @@
 import Foundation
 
 func getAssociatedObject<T>(_ object: Any, _ key: UnsafeRawPointer) -> T? {
-    if #available(iOS 14, macOS 11, *) {
+    if #available(iOS 14, macOS 11, watchOS 7, tvOS 14, *) { // swift 5.3 fixed this issue (https://github.com/apple/swift/issues/46456)
         return objc_getAssociatedObject(object, key) as? T
     } else {
         return objc_getAssociatedObject(object, key) as AnyObject as? T