fetchLatestSupported(completionHandler:)
Fetches the latest restore image supported by this host from the network.
Declaration
@preconcurrency class func fetchLatestSupported(completionHandler: @escaping @Sendable (Result<VZMacOSRestoreImage, any Error>) -> Void)Parameters
- completionHandler:
A block called after the restore image fetch has succeeded or failed. The
errorparameter passed to the block isnilif the image restoration was successful.The system invokes the completion handler on an arbitrary thread. The completion handler returns an
errorparameter that describes the reason for the failure; the block isnilif installation was successful.
Discussion
Construct a VZMacOSInstaller object with a VZMacOSRestoreImage loaded from a file on the local file system. A VZMacOSRestoreImage fetched with the latestSupported method has a URL property that refers to a restore image on the network.
To use a network restore image, download the file to disk (using URLSession or similar API). After downloading the restore image, you can initialize a VZMacOSInstaller using a URL referring to the local file.