<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.13.0 -",
    "tvOS: 11.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 4.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CryptoTokenKit",
  "identifier" : "/documentation/CryptoTokenKit/TKTokenWatcher/setInsertionHandler(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "CryptoTokenKit"
    ],
    "preciseIdentifier" : "c:objc(cs)TKTokenWatcher(im)setInsertionHandler:"
  },
  "title" : "setInsertionHandler(_:)"
}
-->

# setInsertionHandler(_:)

Sets an insertion handler closure to be called when a new token is inserted into the system.

```
func setInsertionHandler(_ insertionHandler: @escaping (String) -> Void)
```

## Parameters

`insertionHandler`

A closure to be called whenever a token is added to the system. The closure takes a single argument, the tokenID, that identifies the added token.

---

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)