load(_:isolation:)
Loads a property asynchronously and returns the value.
Declaration
@backDeployed(before: macOS 26.0, iOS 26.0, tvOS 26.0, watchOS 26.0, visionOS 26.0)
func load<T>(_ property: AVAsyncProperty<Self, T>, isolation: isolated (any Actor)? = #isolation) async throws -> TParameters
- property:
A property to load.
- isolation:
The isolation context.
Mentioned in
Return Value
The loaded property value.
Discussion
Call this method from an asynchronous context to load the value of one or more media properties. The method returns a single result if you load one property value, and returns a tuple if you load multiple properties (up to eight) at the same time.
To load a property, pass one or more AVAsyncProperty constants to this method as shown below.
// Load an asset's list of tracks.
let tracks = try await asset.load(.tracks)
// Load an asset's suitability for playback and export.
let (isPlayable, isExportable) = try await asset.load(.isPlayable, .isExportable)