lock(completionHandler:)
Prevents the user from making changes to the document’s file.
Declaration
func lock(completionHandler: (((any Error)?) -> Void)? = nil)func lock() async throwsParameters
- completionHandler:
The completion handler block object passed in to be invoked after locking is completed, regardless of success or failure of locking.
Discussion
This method first locks the file at [self fileURL] and then invokes the given block. The default locking implementation is to enable the “user immutable” flag on the file.