Contents

addRemovalHandler(_:forTokenID:)

Adds a removal handler for the specified token ID.

Declaration

func addRemovalHandler(_ removalHandler: @escaping (String) -> Void, forTokenID tokenID: String)

Parameters

  • removalHandler:

    A block to be called when the specified token is removed. This block takes a single argument:

    tokenID

    The identifier of the removed token.

  • tokenID:

    The identifier of the token to watch for removal.

    If Tokenids doesn’t contain tokenID, insertionHandler is executed immediately.

Mentioned in

Discussion

You typically call this method in the insertionHandler passed to the token watcher initializer.

Adding a removal handler will remove any existing removal handlers for the specified token ID.

See Also

Configuring Handlers