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 -> IntParameters
- completionHandler:
The completion handler is called on an arbitrary dispatch queue when the replenish operation finishes. The
remainingCapacityparameter reflects the new size in bytes, which may be less than Initialcapacity. If the operation fails, theerrorparameter is set andremainingCapacityis 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.