diff --git a/Package.swift b/Package.swift index e29e1ff..20419a7 100644 --- a/Package.swift +++ b/Package.swift @@ -1,11 +1,11 @@ -// swift-tools-version:5.0 +// swift-tools-version:5.1 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription let package = Package( name: "FocusEntity", - platforms: [.iOS("13.0")], + platforms: [.iOS(.v13), .macOS(.v10_15)], products: [ .library(name: "FocusEntity", targets: ["FocusEntity"]) ], diff --git a/Sources/FocusEntity/FocusEntity.swift b/Sources/FocusEntity/FocusEntity.swift index 6da1ddd..102095a 100644 --- a/Sources/FocusEntity/FocusEntity.swift +++ b/Sources/FocusEntity/FocusEntity.swift @@ -11,6 +11,10 @@ import RealityKit import RealityFoundation #endif +#if os(macOS) || targetEnvironment(simulator) +#warning("FocusEntity: This package is only fully available with physical iOS devices") +#endif + #if canImport(ARKit) && !targetEnvironment(simulator) import ARKit import Combine @@ -338,7 +342,7 @@ open class FocusEntity { self.init() } internal init() { - print("This is not supported when ARKit cannot be imported or using the simulator.") + print("This is only supported on a physical iOS device.") } } #endif diff --git a/Sources/FocusEntity/FocusEntityComponent.swift b/Sources/FocusEntity/FocusEntityComponent.swift index 4508e9c..dae8530 100644 --- a/Sources/FocusEntity/FocusEntityComponent.swift +++ b/Sources/FocusEntity/FocusEntityComponent.swift @@ -7,7 +7,9 @@ // import RealityKit +#if !os(macOS) import ARKit +#endif internal struct ClassicStyle { var color: Material.Color @@ -69,7 +71,9 @@ public struct FocusEntityComponent: Component { ) internal var isOpen = true internal var segments: [FocusEntity.Segment] = [] + #if !os(macOS) public var allowedRaycast: ARRaycastQuery.Target = .estimatedPlane + #endif static var defaultPlane = MeshResource.generatePlane( width: 0.1, depth: 0.1 @@ -79,9 +83,11 @@ public struct FocusEntityComponent: Component { self.style = style // If the device has LiDAR, then default behaviour is to only allow // existing detected planes + #if !os(macOS) if #available(iOS 13.4, *), ARWorldTrackingConfiguration.supportsSceneReconstruction(.mesh) { self.allowedRaycast = .existingPlaneGeometry } + #endif } }