From fcfc8f68d9db40543f881c1f7a10e1ed32f809d5 Mon Sep 17 00:00:00 2001 From: onevcat Date: Sat, 26 Aug 2023 13:30:37 +0900 Subject: [PATCH] Fix xcframework build warnings --- Sources/Cache/CacheSerializer.swift | 5 +++++ Sources/Cache/FormatIndicatedCacheSerializer.swift | 5 +++++ Sources/General/KFOptionsSetter.swift | 5 +++++ Sources/General/KingfisherError.swift | 5 +++++ Sources/General/KingfisherManager.swift | 5 +++++ Sources/Image/Filter.swift | 6 ++++++ Sources/Image/ImageProgressive.swift | 5 +++++ Sources/Networking/ImageDownloaderDelegate.swift | 5 +++++ 8 files changed, 41 insertions(+) diff --git a/Sources/Cache/CacheSerializer.swift b/Sources/Cache/CacheSerializer.swift index f3a94bdaa..c84913ffc 100644 --- a/Sources/Cache/CacheSerializer.swift +++ b/Sources/Cache/CacheSerializer.swift @@ -26,6 +26,11 @@ import Foundation import CoreGraphics +#if os(macOS) +import AppKit +#else +import UIKit +#endif /// An `CacheSerializer` is used to convert some data to an image object after /// retrieving it from disk storage, and vice versa, to convert an image to data object diff --git a/Sources/Cache/FormatIndicatedCacheSerializer.swift b/Sources/Cache/FormatIndicatedCacheSerializer.swift index cdfb7c349..aebc9c814 100644 --- a/Sources/Cache/FormatIndicatedCacheSerializer.swift +++ b/Sources/Cache/FormatIndicatedCacheSerializer.swift @@ -26,6 +26,11 @@ import Foundation import CoreGraphics +#if os(macOS) +import AppKit +#else +import UIKit +#endif /// `FormatIndicatedCacheSerializer` lets you indicate an image format for serialized caches. /// diff --git a/Sources/General/KFOptionsSetter.swift b/Sources/General/KFOptionsSetter.swift index 9a077539a..979ed272e 100644 --- a/Sources/General/KFOptionsSetter.swift +++ b/Sources/General/KFOptionsSetter.swift @@ -26,6 +26,11 @@ import Foundation import CoreGraphics +#if os(macOS) +import AppKit +#else +import UIKit +#endif public protocol KFOptionSetter { var options: KingfisherParsedOptionsInfo { get nonmutating set } diff --git a/Sources/General/KingfisherError.swift b/Sources/General/KingfisherError.swift index 622f63354..c6e79145e 100644 --- a/Sources/General/KingfisherError.swift +++ b/Sources/General/KingfisherError.swift @@ -25,6 +25,11 @@ // THE SOFTWARE. import Foundation +#if os(macOS) +import AppKit +#else +import UIKit +#endif extension Never {} diff --git a/Sources/General/KingfisherManager.swift b/Sources/General/KingfisherManager.swift index 45e166864..1979a8f70 100644 --- a/Sources/General/KingfisherManager.swift +++ b/Sources/General/KingfisherManager.swift @@ -26,6 +26,11 @@ import Foundation +#if os(macOS) +import AppKit +#else +import UIKit +#endif /// The downloading progress block type. /// The parameter value is the `receivedSize` of current response. diff --git a/Sources/Image/Filter.swift b/Sources/Image/Filter.swift index 6e4b386a4..be357cebd 100644 --- a/Sources/Image/Filter.swift +++ b/Sources/Image/Filter.swift @@ -26,6 +26,12 @@ #if !os(watchOS) +#if os(macOS) +import AppKit +#else +import UIKit +#endif + import CoreImage // Reuse the same CI Context for all CI drawing. diff --git a/Sources/Image/ImageProgressive.swift b/Sources/Image/ImageProgressive.swift index a91630081..8ce8f3233 100644 --- a/Sources/Image/ImageProgressive.swift +++ b/Sources/Image/ImageProgressive.swift @@ -26,6 +26,11 @@ import Foundation import CoreGraphics +#if os(macOS) +import AppKit +#else +import UIKit +#endif private let sharedProcessingQueue: CallbackQueue = .dispatch(DispatchQueue(label: "com.onevcat.Kingfisher.ImageDownloader.Process")) diff --git a/Sources/Networking/ImageDownloaderDelegate.swift b/Sources/Networking/ImageDownloaderDelegate.swift index f844ddfc6..7343a249c 100644 --- a/Sources/Networking/ImageDownloaderDelegate.swift +++ b/Sources/Networking/ImageDownloaderDelegate.swift @@ -25,6 +25,11 @@ // THE SOFTWARE. import Foundation +#if os(macOS) +import AppKit +#else +import UIKit +#endif /// Protocol of `ImageDownloader`. This protocol provides a set of methods which are related to image downloader /// working stages and rules.