Marino Faggiana 6 年之前
父节点
当前提交
c9a1380247
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      iOSClient/Utility/NCUtility.swift

+ 4 - 2
iOSClient/Utility/NCUtility.swift

@@ -81,8 +81,10 @@ class NCUtility: NSObject {
         let resources = PHAssetResource.assetResources(for: asset)
         
         if let resource = resources.first {
-            let unsignedInt64 = resource.value(forKey: "fileSize") as! CLong
-            return Int64(bitPattern: UInt64(unsignedInt64))
+            if resource.responds(to: #selector(NSDictionary.fileSize)) {
+                let unsignedInt64 = resource.value(forKey: "fileSize") as! CLong
+                return Int64(bitPattern: UInt64(unsignedInt64))
+            }
         }
         
         return 0