Instance Method

lock(completionHandler:)

Prevents further modifications from being made to the file.

Declaration

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

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 Documents

func lock(Any?)

Locks the document in response to the user choosing the Lock menu item.

func unlock(Any?)

Unlocks the document in response to the user choosing the Unlock menu item.

func lock(completionHandler: ((Bool) -> Void)?)

Prevents the user from making further changes to the document.

func unlock(completionHandler: ((Bool) -> Void)?)

Allows the user to make modifications to the document.

func unlock(completionHandler: ((Error?) -> Void)?)

Allows the user to make modifications to the file.

var isLocked: Bool

A Boolean value indicating whether or not the file can be written to.