Contents

lock(completionHandler:)

Prevents the user from making changes to the document’s file.

Declaration

func lock(completionHandler: (((any Error)?) -> Void)? = nil)
func lock() async throws

Parameters

  • 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.

See Also

Locking the Document