AVAsynchronousKeyValueLoading
A protocol that defines the interface to load media data asynchronously.
Declaration
protocol AVAsynchronousKeyValueLoadingMentioned in
Overview
Loading media data takes an amount of time that depends on factors including the media’s size, location, device capabilities, network conditions, and so on. To optimize performance, AVAsset defers loading its media data until you query its properties or perform an operation that requires it. This means that performing these actions from a synchronous context would block the calling thread for an unknown amount of time, which would result in a poor user experience, and may even cause your app to crash. For this reason, you must load media data asynchronously.
Call the asynchronous load(_:isolation:) method to retrieve the values of media properties, or determine the loaded status of a property by calling the status(of:) method. See Loading media data asynchronously for more information.