Instance Method

exportAsynchronouslyWithCompletionHandler:

Starts the asynchronous execution of an export session.

Declaration

- (void)exportAsynchronouslyWithCompletionHandler:(void (^)(void))handler;

Parameters

handler

A block that is invoked when writing is complete or in the event of writing failure.

Discussion

This method starts an asynchronous export operation and returns immediately. status signals the terminal state of the export session, and if a failure occurs, error describes the problem.

If internal preparation for export fails, handler is invoked synchronously. The handler may also be called asynchronously, after the method returns, in the following cases:

  1. If a failure occurs during the export, including failures of loading, re-encoding, or writing media data to the output.

  2. If cancelExport is invoked.

  3. After the export session succeeds, having completely written its output to the outputURL.

See Also

Exporting Media

- cancelExport

Cancels the execution of an export session.

error

Describes the error that occurred.

AVAssetExportSessionStatus

A set of statuses used for relaying the state of an export session.

estimatedOutputFileLength

The estimated size, in bytes, of the exported file.

maxDuration

Provides an estimate of the maximum duration of the exported media.