<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreNFC",
  "identifier" : "/documentation/CoreNFC/NFCNDEFTag/writeLock(completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core NFC"
    ],
    "preciseIdentifier" : "c:objc(pl)NFCNDEFTag(im)writeLockWithCompletionHandler:"
  },
  "title" : "writeLock(completionHandler:)"
}
-->

# writeLock(completionHandler:)

Changes the NDEF tag status to read-only, preventing future write operations.

```
func writeLock(completionHandler: @escaping @Sendable ((any Error)?) -> Void)
```

## Parameters

`completionHandler`

The handler invoked by the reader session after completing the lock request. The session calls `completionHandler` on the dispatch queue provided when creating the [`NFCNDEFReaderSession`](/documentation/CoreNFC/NFCNDEFReaderSession).

    The handler has the following parameter:

- error: An <doc://com.apple.documentation/documentation/Foundation/NSError> object if the write request fails. A value of `nil` indicates that the session locked the tag and future write requests aren’t possible.

## Discussion

Calling this method updates the write access condition byte in the NDEF File Control of the tag’s file system, thus locking the tag. This is a permanent action that you cannot undo. After locking the tag, you can no longer write data to it.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)