Contents

waitForStabilization(completionHandler:)

Requests a notification after the domain stabilizes.

Declaration

func waitForStabilization(completionHandler: @escaping  @Sendable ((any Error)?) -> Void)
func waitForStabilization() async throws

Parameters

  • completionHandler:

    A block that the system calls after pending changes to both the file system and the provider have completed. The system passes the following parameters:

    error

    If an error occurs, this object contains information about the error; otherwise, it’s nil.

Discussion

Use this method to enforce a consistent state for testing. The system calls the completion handler after all the pending changes to the local cache and the remote storage have completed. The system waits on any changes that requested before the call to waitForStabilization(completionHandler:), but which haven’t completed yet.

See Also

Working with domains