I was able to build and run the project using Xcode 13, Beta 2 (13A5155e), after installing macOS Monterey Beta 2 (21A5268h). There were some modifications needed to the Creating a Photogrammetry Command-Line App, as it appears the PhotogrammetrySession
framework has had some changes between macOS 12 Beta 1 and Beta 2. I made the following changes;
- I removed lines 35-39 in
main.swift
. It appears that the sampleOverlap
property of PhotogrammetrySession.Configuration
has been removed. Removing lines 35-39 resolves the HelloPhotogrammetry
struct conformance errors. - It appears the
PhotogrammetrySession.Output
property has been removed, replacing the built-in Combine publisher with an ASyncInterator. This was alluded to in the WWDC21-10076 session, but I replaced the Combine publisher (lines 69-103) in main.swift
with the following;
Task.init(priority: .default) {
do {
for try await output in session.outputs {
switch output {
case .requestProgress(let request, fractionComplete: let fraction):
handleRequestProgress(request: request, fractionComplete: fraction)
case .requestComplete(let request, let result):
handleRequestComplete(request: request, result: result)
case .requestError(let request, let error):
print("Request \(String(describing: request)) had an error: \(String(describing: error))")
case .processingComplete:
// All requests are done so you can safely exit.
print("Processing is complete!")
Foundation.exit(0)
case .inputComplete: // Data ingestion has finished.
print("Data ingestion is complete. Beginning processing...")
case .invalidSample(let id, let reason):
print("Invalid Sample! id=\(id) reason=\"\(reason)\"")
case .skippedSample(let id):
print("Sample id=\(id) was skipped by processing.")
case .automaticDownsampling:
print("Automatic downsampling was applied!")
default:
print("Output: unhandled message: \(output.localizedDescription)")
}
}
}
}
Because of this change, I also removed subscriptions
property from withExtendedLifetime
(just below the session output code), which should change the call from withExtendedLifetime((session, subscriptions))
to withExtendedLifetime(session)
.
TLDR; Remove the sampleOverlap
property from main.swift
and change the session.output
, which was a Combine publisher, to session.outputs
, then iterate over the AsyncIterator
, as was demoed in the WWDC21-10076 session. If you have Xcode 13 Beta 2 and macOS Monterey Beta 2 installed, this should now run as expected.