diff --git a/Sources/GISTools/GeoJson/GeoJsonCodable.swift b/Sources/GISTools/GeoJson/GeoJsonCodable.swift index a9b174b..e22f1e8 100644 --- a/Sources/GISTools/GeoJson/GeoJsonCodable.swift +++ b/Sources/GISTools/GeoJson/GeoJsonCodable.swift @@ -91,6 +91,7 @@ extension Coordinate3D: Codable { // MARK: - SwiftData compatibility (see the README) +#if canImport(SwiftData) @objc(GeoJsonTransformer) public final class GeoJsonTransformer: ValueTransformer { @@ -124,6 +125,7 @@ public final class GeoJsonTransformer: ValueTransformer { } } +#endif // MARK: - Private diff --git a/Tests/GISToolsTests/GeoJson/SwiftDataTests.swift b/Tests/GISToolsTests/GeoJson/SwiftDataTests.swift index 6c6cc82..62a9684 100644 --- a/Tests/GISToolsTests/GeoJson/SwiftDataTests.swift +++ b/Tests/GISToolsTests/GeoJson/SwiftDataTests.swift @@ -1,8 +1,10 @@ @testable import GISTools -import SwiftData import XCTest -@available(macOS 14, *) +#if canImport(SwiftData) +import SwiftData + +@available(macOS 14, iOS 17, watchOS 10, tvOS 17, *) final class SwiftDataTests: XCTestCase { @Model @@ -56,3 +58,4 @@ final class SwiftDataTests: XCTestCase { } } +#endif