Instance Method

unlock(completionHandler:)

Allows the user to make modifications to the document.

Declaration

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

Parameters

completionHandler

The completion handler block object passed in to be invoked after unlocking is completed, regardless of success or failure.

Discussion

By default, this method invokes the unlock(completionHandler:) method to unlock the document. This method disables autosaving safety checking, meaning that checkAutosavingSafety() will no longer be invoked on this document. When unlocking succeeds, the isLocked method will begin returning false.

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 lock(completionHandler: ((Error?) -> Void)?)

Prevents further modifications from being made to the file.

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.