There was a typo in the code of my original post, to be clear, the assertion failure happens after calling startDetecting instead of session.start(imagesDirectory:configuration:)
if case .initializing = session.state {
Button {
session.start(imagesDirectory: getDocumentsDir().appendingPathComponent("Images/"), configuration: configuration) // everything's alright after this
} label: {
Text("Prepare")
}
} else if case .ready = session.state {
Button {
session.() // 💥
} label: {
Text("Continue")
}
}
Topic:
App & System Services
SubTopic:
Core OS
Tags: