Waits for any scheduled file access to complete but without blocking the main thread, then invokes the passed-in block.
- macOS 10.7+
A block that performs file access.
This method does the same sort of work as
perform, but without ever blocking the main thread, and may not invoke the block until after the method invocation has returned, though still always on the same thread as the method invocation. The block is passed another block, the file access completion handler, which must be invoked when the file access is complete, though it can be invoked from any thread. This method is for use with file access that might begin on one thread but continue on another before it is complete. For example,
save(to: uses this method instead of
perform because if it does asynchronous saving then there is no way for it to complete all of its file access before returning from the file access block.