Async/Await with PhotogrammetrySession

I'm trying out the PhotogrammetrySession api following the wwdc2021-10076 tutorial here

However I get this error when trying the async/await for looping the session.output

For-in loop requires 'AnyPublisher<PhotogrammetrySession.Output, Error>' to conform to 'AsyncSequence'

Code:

async {

    for try await output in session.output {

        switch output {

        case .requestProgress(let request, let fraction):

            print("Request progressL \(fraction)")

        }

    }

}

Using Xcode 13.0 beta and macOS 12.0 Beta. MacBook Pro (15-inch, 2019) Thanks.

I have the same question! The sample code shows an outputs property on session but only output exists in Xcode, which is for the Combine publisher.

The API described in the session video is slightly different than the one that shipped with the beta. The beta API uses a Combine Publisher named output to produce the message stream. The Output messages are the same, but for this version you will need to use a Combine pipeline to dispatch messages rather than the AsyncStream approach referred to in the video. For an example of how to do this, please see the command-line app sample code HelloPhotogrammetry which uses a Combine sink to dispatch messages.

Async/Await with PhotogrammetrySession
 
 
Q