Contents

replenishCapacity(completionHandler:)

Performs a best-effort attempt to restore Pro Video Storage to the initial capacity specified by the user in Settings app.

Declaration

func replenishCapacity(completionHandler: (@Sendable (Int, (any Error)?) -> Void)? = nil)
func replenishCapacity() async throws -> Int

Parameters

  • completionHandler:

    The completion handler is called on an arbitrary dispatch queue when the replenish operation finishes. The remainingCapacity parameter reflects the new size in bytes, which may be less than Initialcapacity. If the operation fails, the error parameter is set and remainingCapacity is unchanged or -1 if there was a failure retrieving the value.

Discussion

If there is enough readily available free space on the file system, Pro Video Storage will be resized to initialCapacity. Otherwise, this method will attempt to resize it near that value.

Pro Video Storage is busy when the replenish operation starts and is no longer busy when the completion handler is called.

See Also

Inspecting capacity