<!--
{
  "availability" : [
    "iOS: 18.1.0 -",
    "iPadOS: 18.1.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SecureElementCredential",
  "identifier" : "/documentation/SecureElementCredential/CredentialTransaction",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "SecureElementCredential",
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:32_SecureElementCredential_SwiftUI0C11TransactionC"
  },
  "title" : "CredentialTransaction"
}
-->

# CredentialTransaction

A transaction object for performing wired and contactless operations in SwiftUI views.

```
class CredentialTransaction
```

## Overview

Use the <doc://com.apple.documentation/documentation/SwiftUI/View/transactionTask(_:action:)> view modifier to create a task for working with a credential. The `action` closure receives a `CredentialTransaction` instance that it can perform actions on.

You can call the methods of `CredentialTransaction` and [`CredentialTransaction.Configuration`](/documentation/SecureElementCredential/CredentialTransaction/Configuration) from both apps and app extensions.

> Warning: Don’t import UIKit in any file that imports this type. This causes ambiguity resolving the ``doc://SecureElementCredential/documentation/SecureElementCredential`` framework’s SwiftUI and UIKit symbols.

## Topics

### Configuring transactions

[`class Configuration`](/documentation/SecureElementCredential/CredentialTransaction/Configuration)

An object that provides configuration information for a transaction that the client intends to perform.

### Performing transactions

[`func performTransaction(using: Credential, options: CardEmulationOptions) async throws`](/documentation/SecureElementCredential/CredentialTransaction/performTransaction(using:options:))

Prompts the user for authorization and then activates a credential for card emulation.

[`func performTransactionInWiredMode(using: Credential, instanceAID: Data) async throws`](/documentation/SecureElementCredential/CredentialTransaction/performTransactionInWiredMode(using:instanceAID:))

Enters wired mode to perform a transaction.

[`func performCardEmulationTransactionWithCurrentCredential(options: CardEmulationOptions) async throws`](/documentation/SecureElementCredential/CredentialTransaction/performCardEmulationTransactionWithCurrentCredential(options:))

Activate the current credential to perform a transaction in card emulation mode.

### Supporting types

[`typealias Credential`](/documentation/SecureElementCredential/Credential)

[`typealias CardEmulationOptions`](/documentation/SecureElementCredential/CardEmulationOptions)



---

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)