As the scene data providers in ARKit on visionOS simulator are not supported, I try to create my own with dummy data.
As soon as I try to run an ARKit session with an instance of that provider I get a crash (EXC_BREAKPOINT).
So what am I doing wrong?
Definition of data provider:
@available(visionOS 1.0, *)
public final class TestSceneDataProvider: DataProvider, Equatable, @unchecked Sendable {
public static func == (lhs: TestSceneDataProvider, rhs: TestSceneDataProvider) -> Bool {
lhs.id == rhs.id
}
public typealias ID = UUID
public var id: UUID = UUID()
public static var isSupported: Bool = true
public static var requiredAuthorizations: [ARKitSession.AuthorizationType] = []
public var state: DataProviderState = .initialized
public var description: String = "TestSceneDataProvider"
}
Running the session:
do {
if TestSceneDataProvider.isSupported {
print("ARKitSession starting.")
let sceneReconstruction = TestSceneDataProvider()
try await session.run([sceneReconstruction])
}
} catch {
print("ARKitSession error:", error)
}