From 1fdae3b3edca2b47dedd3c4cfc72a927c9fdc0ab Mon Sep 17 00:00:00 2001 From: onevcat Date: Sun, 6 Oct 2024 22:10:57 +0900 Subject: [PATCH] Opt out watchOS target for live photo --- Sources/Extensions/PHLivePhotoView+Kingfisher.swift | 6 ++++++ Sources/General/Kingfisher.swift | 2 +- Sources/General/KingfisherManager+LivePhoto.swift | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Sources/Extensions/PHLivePhotoView+Kingfisher.swift b/Sources/Extensions/PHLivePhotoView+Kingfisher.swift index 5e532946a..ae22398bb 100644 --- a/Sources/Extensions/PHLivePhotoView+Kingfisher.swift +++ b/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 diff --git a/Sources/General/Kingfisher.swift b/Sources/General/Kingfisher.swift index 53a91ddbb..b890d24b3 100644 --- a/Sources/General/Kingfisher.swift +++ b/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 diff --git a/Sources/General/KingfisherManager+LivePhoto.swift b/Sources/General/KingfisherManager+LivePhoto.swift index 5e22e716b..46be06e37 100644 --- a/Sources/General/KingfisherManager+LivePhoto.swift +++ b/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