Contents

waitForChanges(below:completionHandler:)

Requests a notification after the system completes all the specified changes.

Declaration

func waitForChanges(below itemIdentifier: NSFileProviderItemIdentifier, completionHandler: @escaping  @Sendable ((any Error)?) -> Void)
func waitForChanges(below itemIdentifier: NSFileProviderItemIdentifier) async throws

Parameters

  • itemIdentifier:

    The item’s identifier.

  • completionHandler:

    A block that the system calls after all the changes are complete. The block takes the following parameters:

    error

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

Discussion

This method waits for all the changes to the item’s descendants to complete before calling the completion handler. If an error occurs during this process, the system immediately passes the error to the completion handler, and you can’t assume all the changes have completed.

If the itemIdentifier property doesn’t refer to a directory, this method immediately calls the completion handler.

See Also

Performing actions