## Coupler arrival and removal

Couplers and tags are reported apart from the other devices, through **CaptureHelperPcscDelegate**. Add it to the delegate you push to Capture Helper. A coupler in coupler mode arrives through **didNotifyArrivalForCoupler** and **didNotifyRemovalForCoupler** is called when the coupler disconnects.

## Swift

```swift
var coupler: CaptureHelperDevice?

extension MyViewController: CaptureHelperPcscDelegate {

    func didNotifyArrivalForCoupler(_ coupler: CaptureHelperDevice, withResult result: SKTResult) {
        print("didNotifyArrivalForCoupler: \(coupler.deviceInfo.name ?? "") - Result: \(result.rawValue)")
        self.coupler = coupler
    }

    func didNotifyRemovalForCoupler(_ coupler: CaptureHelperDevice, withResult result: SKTResult) {
        print("didNotifyRemovalForCoupler: \(coupler.deviceInfo.name ?? "") - Result: \(result.rawValue)")
        self.coupler = nil
    }

}
```

# Reader and Coupler Modes

Use a Socket Mobile NFC reader as a PC/SC coupler with the iOS CaptureSDK. Covers switching an NFC reader from reader mode to coupler mode and back, and handling coupler arrival and removal with CaptureHelperPcscDelegate. Includes Swift code samples.

An NFC reader works in one of two modes. In **reader** mode it reads tags on its own and sends their data as decoded data, like a barcode scanner. In **coupler** mode it acts as a PC/SC (Personal Computer/Smart Card) coupler: your application exchanges commands (APDUs) with the tag presented to it, for instance to read or write its memory.

## Switching modes

> ****
>
> Both switches end with a soft reset of the device. The device must be plugged in for this reset to complete properly.

### Switching to coupler mode

An NFC reader in reader mode arrives through **didNotifyArrivalForDevice**. Call **switchDeviceToCoupler** on it.

## Swift

```swift
var device: CaptureHelperDevice?

device.switchDeviceToCoupler { result in
    print("switchDeviceToCoupler - Result: \(result.rawValue)")
}
```

### Switching back to reader mode

Once in coupler mode, the device arrives as a coupler. Call **switchDeviceToReader** on the coupler to go back to reader mode.

## Swift

```swift
var coupler: CaptureHelperDevice?

coupler.switchDeviceToReader { result in
    print("switchDeviceToReader - Result: \(result.rawValue)")
}
```