# NFC

It contains two methods to start NFC:

1. Manual NFC, where you send the MRZ data for the nfc scan
2. Auto NFC, where it has a step to take a photo of mrz code, and then starts nfc scan.

```swift
//Manual
BiometridStandard.getInstance().startNFC(viewController: self, mrz: mrzCode, nfcCustomization: nfcCustomization, callback: self)
//Auto
BiometridStandard.getInstance().startNFC(viewController: self, nfcCustomization: nfcCustomization, callback: self)
```

<table><thead><tr><th width="395">Parameter</th><th>Description</th></tr></thead><tbody><tr><td>viewController: <strong>UIViewController</strong></td><td>View Controller to open the NFC screen</td></tr><tr><td>mrz: <strong>MRZKey</strong></td><td>Data with MRZ of passport or ID Card which you want to scan</td></tr><tr><td>options: <strong>NFCCustomization?</strong></td><td>Options to change customization of nfc screen</td></tr><tr><td>callback: <strong>ProcessCallback?</strong></td><td>callback</td></tr></tbody></table>

## Implementation example

```swift
import UIKit
import BiometridStandardSDK

class ViewController: UIViewController, ProcessCallback {    
    override func viewDidLoad() {
        super.viewDidLoad()
    }
    
    @IBAction func startManualNFCBtn(_ sender: Any) {
        let customization = NFCCustomization()
        BiometridStandard.getInstance().startNFC(viewController: self, mrz: passportMRZ, nfcCustomization: customization, callback: self)
    }
    
    @IBAction func startAutoNFCBtn(_ sender: Any) {
        let customization = NFCCustomization()
        BiometridStandard.getInstance().startNFC(viewController: self, nfcCustomization: customization, callback: self)
    }
    
    func nfcCallback(document: NFCData?, error: Errors?) {
        if error != nil {
            print(error?.rawValue)
            return
        }
        print("document", document)
    }
}
```

## Callback params

<table data-header-hidden><thead><tr><th width="228">Parameter</th><th>Description</th></tr></thead><tbody><tr><td>document: <strong>NFCData?</strong></td><td>Object containing all the extracted data from the scanned document</td></tr><tr><td>errors: <strong>Errors?</strong></td><td>Errors associated enum</td></tr></tbody></table>
