---
title: "init(source:)"
framework: cryptotokenkit
role: symbol
role_heading: Initializer
path: "cryptotokenkit/tksmartcardatr/init(source:)"
---

# init(source:)

Initializes a TKSmartCardATR object from a provided data source.

## Declaration

```swift
init?(source: @escaping () -> Int32)
```

## Parameters

- `source`: The block providing a stream of data for an ATR. The block takes no arguments and returns one byte. To indicate that an error occured, the block returns -1.

## Return Value

Return Value A TKSmartCardATR object initialized with the parsed data. If the byte stream produces an error or does not contain a valid ATR, returns nil.

## See Also

### Creating a Smart Card ATR

- [init(bytes:)](cryptotokenkit/tksmartcardatr/init(bytes:).md)
