From c68612785ea799ce7fcd8dc9488b710b7a95afb7 Mon Sep 17 00:00:00 2001 From: xuty Date: Wed, 11 Dec 2024 17:38:06 +0800 Subject: [PATCH] Fix Linux build --- Sources/Shaft/Painting/ImageProvider.swift | 5 +++++ Sources/Shaft/Widgets/Image.swift | 4 ---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Sources/Shaft/Painting/ImageProvider.swift b/Sources/Shaft/Painting/ImageProvider.swift index 3bd210d..0f3e262 100644 --- a/Sources/Shaft/Painting/ImageProvider.swift +++ b/Sources/Shaft/Painting/ImageProvider.swift @@ -8,6 +8,11 @@ import Foundation +/// For non-Apple platforms +#if canImport(FoundationNetworking) + import FoundationNetworking +#endif + /// Configuration information passed to the [ImageProvider.resolve] method to /// select a specific image. public struct ImageConfiguration: Equatable { diff --git a/Sources/Shaft/Widgets/Image.swift b/Sources/Shaft/Widgets/Image.swift index 725a7e4..a21c8b0 100644 --- a/Sources/Shaft/Widgets/Image.swift +++ b/Sources/Shaft/Widgets/Image.swift @@ -8,10 +8,6 @@ import Foundation -#if canImport(FoundationNetworking) - import FoundationNetworking -#endif - /// Signature used by [Image.frameBuilder] to control the widget that will be /// used when an [Image] is built. ///