<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 11.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 4.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CryptoTokenKit",
  "identifier" : "/documentation/CryptoTokenKit/TKSmartCardUserInteraction",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "CryptoTokenKit"
    ],
    "preciseIdentifier" : "c:objc(cs)TKSmartCardUserInteraction"
  },
  "title" : "TKSmartCardUserInteraction"
}
-->

# TKSmartCardUserInteraction

The base class for encapsulating user interaction with a Smart Card reader.

```
class TKSmartCardUserInteraction
```

## Overview

There are two types of user interactions: those for secure PIN change and those for secure PIN validation. These interactions are instances of the [`TKSmartCardUserInteractionForSecurePINChange`](/documentation/CryptoTokenKit/TKSmartCardUserInteractionForSecurePINChange), or [`TKSmartCardUserInteractionForSecurePINVerification`](/documentation/CryptoTokenKit/TKSmartCardUserInteractionForSecurePINVerification) subclasses of [`TKSmartCardUserInteractionForPINOperation`](/documentation/CryptoTokenKit/TKSmartCardUserInteractionForPINOperation), respectively. [`TKSmartCardUserInteractionForPINOperation`](/documentation/CryptoTokenKit/TKSmartCardUserInteractionForPINOperation) is a subclass of `TKSmartCardUserInteraction`.

You interact with instances of one of the subclasses of [`TKSmartCardUserInteractionForPINOperation`](/documentation/CryptoTokenKit/TKSmartCardUserInteractionForPINOperation)when calling the [`userInteractionForSecurePINChange(_:apdu:currentPINByteOffset:newPINByteOffset:)`](/documentation/CryptoTokenKit/TKSmartCard/userInteractionForSecurePINChange(_:apdu:currentPINByteOffset:newPINByteOffset:)) and [`userInteractionForSecurePINVerification(_:apdu:pinByteOffset:)`](/documentation/CryptoTokenKit/TKSmartCard/userInteractionForSecurePINVerification(_:apdu:pinByteOffset:)) methods on an [`TKSmartCard`](/documentation/CryptoTokenKit/TKSmartCard) object.

## Topics

### Handling User Interaction Events

[`delegate`](/documentation/CryptoTokenKit/TKSmartCardUserInteraction/delegate)

The delegate for observing events that occur during the user interaction.

[`TKSmartCardUserInteractionDelegate`](/documentation/CryptoTokenKit/TKSmartCardUserInteractionDelegate)

The interface implemented by a Smart Card user interaction delegate to handle user interaction events.

### Configuring Timeout

[`initialTimeout`](/documentation/CryptoTokenKit/TKSmartCardUserInteraction/initialTimeout)

The timeout, in seconds, for initial interaction. If set to `0`, the reader-defined default timeout is used. `0` by default.

[`interactionTimeout`](/documentation/CryptoTokenKit/TKSmartCardUserInteraction/interactionTimeout)

The timeout, in seconds, after the first key stroke. If set to `0`, the reader-defined default timeout is used. `0` by default.

### Starting and Stopping

[`run(reply:)`](/documentation/CryptoTokenKit/TKSmartCardUserInteraction/run(reply:))

Runs the user interaction and asynchronously receives a reply.

[`cancel()`](/documentation/CryptoTokenKit/TKSmartCardUserInteraction/cancel())

Attempts to cancel an interaction started by calling [`run(reply:)`](/documentation/CryptoTokenKit/TKSmartCardUserInteraction/run(reply:)). For certain interactions, cancellation may not be available.



---

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)