Tells the asset to load the values of all of the specified keys (property names) that are not already loaded.
- iOS 4.0+
- macOS 10.7+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 6.0+
An array of strings containing the required keys.
The keys are the property names of a class that adopts the protocol.
The block to be invoked when loading succeeds, fails, or is cancelled.
Regardless of the number of keys specified, the completion handler will be invoked exactly once per invocation of this method. This method will be called:
Synchronously if all specified keys have previously been loaded (a status of
AVKey) or if an I/O error or other format-related error occurs immediately.
Value Status .loaded
Asynchronously when the values of all of the specified keys become loaded, if a loading error occurs at a later stage of processing, or if
cancelis invoked on an
AVAssetinstance. The callback will be invoked on an arbitrary background queue. You should dispatch back to the main queue before performing any user interface-related operations.
The completion states of the keys you specify in
keys are not necessarily the same—some may be loaded, and others may have failed. You must check the status of each key individually using the
You can call this method at any time, even after an asset has begun to load data for operations in progress or already completed. Whenever any module requires a certain collection of key-values, it can call this method and be assured of receiving its specified callback as soon as possible.
The following example shows how to use this method to load an asset’s