Skip to content

Commit

Permalink
Opt out watchOS target for live photo
Browse files Browse the repository at this point in the history
  • Loading branch information
onevcat committed Oct 6, 2024
1 parent 444fabe commit 1fdae3b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions Sources/Extensions/PHLivePhotoView+Kingfisher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -193,3 +198,4 @@ extension KingfisherWrapper where Base: PHLivePhotoView {
return .imageSettingError(reason: .notCurrentLivePhotoSourceTask(result: result, error: error, source: source))
}
}
#endif
2 changes: 1 addition & 1 deletion Sources/General/Kingfisher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions Sources/General/KingfisherManager+LivePhoto.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -201,3 +202,4 @@ extension ImageCache {
}
}
}
#endif

0 comments on commit 1fdae3b

Please sign in to comment.