Notifies your object that another object or process wants to write to the presented file or directory.
- iOS 5.0+
- macOS 10.7+
- Mac Catalyst 13.0+Beta
- tvOS 9.0+
- watchOS 2.0+
A Block object that takes another block as a parameter and returns no value. The
reacquirerblock is one you pass to the
writerblock so that your object can be notified when the
writeris done. If your object does not need to be notified, it can pass
You use this method to provide an appropriate response when another object wants to write to your presented URL. For example, when this method is called, you would likely stop making changes to the file or directory. After taking any appropriate steps, you must execute the block in the
writer parameter to let the waiting object know that it may now proceed with its task. If you want to be notified when the writer has completed its task, pass your own block to the writer and use that block to reacquire the file or URL for your own uses.
If the writer changes the file or directory, you do not need to incorporate those changes in your reacquirer block. Instead, implement the
presented method and use it to detect when a writer actually wrote its changes to disk.
The following listing shows a simple implementation of this method that sets a Boolean flag that the file being monitored is not writable at the moment. After setting the flag, it executes the writer block and passes in yet another block for the writer to execute when it is done.
Your implementation of this method is executed using the queue in the
presented property. Your reacquirer block is executed on the queue associated with the writer.