From 31c0dd2d45f65478e5e20eab4496196671c9d216 Mon Sep 17 00:00:00 2001 From: Thomas Rasch Date: Thu, 23 May 2024 13:06:44 +0200 Subject: [PATCH] Reorganizing availability --- Sources/GISTools/GeoJson/GeoJsonCodable.swift | 2 ++ Tests/GISToolsTests/GeoJson/SwiftDataTests.swift | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) 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