Selaa lähdekoodia

Opt out watchOS target for live photo

onevcat 1 vuosi sitten
vanhempi
commit
1fdae3b3ed

+ 6 - 0
Sources/Extensions/PHLivePhotoView+Kingfisher.swift

@@ -24,6 +24,11 @@
 //  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 //  THE SOFTWARE.
 
+#if os(watchOS)
+// Only a placeholder.
+public struct RetrieveLivePhotoResult: @unchecked Sendable {
+}
+#else
 @preconcurrency import PhotosUI
 
 public struct RetrieveLivePhotoResult: @unchecked Sendable {
@@ -193,3 +198,4 @@ extension KingfisherWrapper where Base: PHLivePhotoView {
         return .imageSettingError(reason: .notCurrentLivePhotoSourceTask(result: result, error: error, source: source))
     }
 }
+#endif

+ 1 - 1
Sources/General/Kingfisher.swift

@@ -114,7 +114,7 @@ extension NSTextAttachment          : KingfisherCompatible { }
 extension WKInterfaceImage          : KingfisherCompatible { }
 #endif
 
-#if canImport(PhotosUI)
+#if canImport(PhotosUI) && !os(watchOS)
 import PhotosUI
 extension PHLivePhotoView           : KingfisherCompatible { }
 #endif

+ 2 - 0
Sources/General/KingfisherManager+LivePhoto.swift

@@ -24,6 +24,7 @@
 //  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 //  THE SOFTWARE.
 
+#if !os(watchOS)
 @preconcurrency import Photos
 
 public struct LivePhotoLoadingInfoResult: Sendable {
@@ -201,3 +202,4 @@ extension ImageCache {
         }
     }
 }
+#endif