One Logo Pool Ball
RealityFoundation · IOS API REFERENCE

PhotogrammetrySession.Outputs

struct · iOS 17.0+ · SDK 27.1

struct Outputs

An asynchronous sequence of session-related updates.

Members (1)

method · iOS 17.0+

makeAsyncIterator

TypeScript
makeAsyncIterator(): PhotogrammetrySession_Outputs_Iterator
Swift declaration
func makeAsyncIterator() -> PhotogrammetrySession.Outputs.Iterator

Creates an asynchronous iterator for the collection. - Returns: An asynchronous iterator. This method creates an asynchronous iterator for the collection. Typically, you won’t call this method. Instead, use a `try`-`await`-`in` loop inside of an `async` task, which creates an iterator implicitly and waits for the session to publish new ``RealityKit/PhotogrammetrySession/Output`` objects, as the following example demonstrates. ```swift let waiter = Task { do { for try await output in session.outputs { switch output { case .processingComplete: // RealityKit has processed all requests. case .requestError(let request, let error): // Request encountered an error. case .requestComplete(let request, let result): // RealityKit has finished processing a request. case .requestProgress(let request, let fractionComplete): // Periodic progress update. Update UI here. case requestProgressInfo(let request, let progressInfo): // Periodic progress info update. case .inputComplete: // Ingestion of images is complete and processing begins. case .invalidSample(let id, let reason): // RealityKit deemed a sample invalid and didn't use it. case .skippedSample(let id): // RealityKit was unable to use a provided sample. case .automaticDownsampling: // RealityKit downsampled the input images because of // resource constraints. case .processingCancelled // Processing was canceled. @unknown default: // Unrecognized output. } } } catch { print("Output: ERROR = \(String(describing: error))") // Handle error. } } ```

Skipped declarations

No declarations were skipped in this snapshot.

All RealityFoundation types →