diff --git a/Sources/Private/Model/DotLottie/DotLottieImageProvider.swift b/Sources/Private/Model/DotLottie/DotLottieImageProvider.swift index cd560add4b..e426fc0a24 100644 --- a/Sources/Private/Model/DotLottie/DotLottieImageProvider.swift +++ b/Sources/Private/Model/DotLottie/DotLottieImageProvider.swift @@ -55,14 +55,14 @@ class DotLottieImageProvider: AnimationImageProvider { private func loadImages() { for url in filepath.urls { - #if os(iOS) || os(tvOS) || os(watchOS) || targetEnvironment(macCatalyst) + #if canImport(UIKit) if let data = try? Data(contentsOf: url), let image = UIImage(data: data)?.cgImage { images[url.lastPathComponent] = image } - #elseif os(macOS) + #elseif canImport(AppKit) if let data = try? Data(contentsOf: url), let image = NSImage(data: data)?.lottie_CGImage diff --git a/Sources/Private/Model/Extensions/Bundle.swift b/Sources/Private/Model/Extensions/Bundle.swift index 10c85bad1f..65f7c5b3a5 100644 --- a/Sources/Private/Model/Extensions/Bundle.swift +++ b/Sources/Private/Model/Extensions/Bundle.swift @@ -1,5 +1,5 @@ import Foundation -#if os(iOS) || os(tvOS) || os(watchOS) || targetEnvironment(macCatalyst) +#if canImport(UIKit) import UIKit #endif diff --git a/Sources/Public/iOS/Compatibility/CompatibleAnimationKeypath.swift b/Sources/Public/iOS/Compatibility/CompatibleAnimationKeypath.swift index 73963557f9..facb4e647b 100644 --- a/Sources/Public/iOS/Compatibility/CompatibleAnimationKeypath.swift +++ b/Sources/Public/iOS/Compatibility/CompatibleAnimationKeypath.swift @@ -6,7 +6,7 @@ // import Foundation -#if os(iOS) || os(tvOS) || os(watchOS) || targetEnvironment(macCatalyst) +#if canImport(UIKit) /// An Objective-C compatible wrapper around Lottie's AnimationKeypath @objc diff --git a/Sources/Public/iOS/Compatibility/CompatibleAnimationView.swift b/Sources/Public/iOS/Compatibility/CompatibleAnimationView.swift index 4e6acdc17c..9b788fc6c2 100644 --- a/Sources/Public/iOS/Compatibility/CompatibleAnimationView.swift +++ b/Sources/Public/iOS/Compatibility/CompatibleAnimationView.swift @@ -6,7 +6,7 @@ // import Foundation -#if os(iOS) || os(tvOS) || os(watchOS) || targetEnvironment(macCatalyst) +#if canImport(UIKit) import UIKit /// An Objective-C compatible wrapper around Lottie's Animation class.