# Auto Capture

<pre class="language-swift"><code class="lang-swift">// Starts automatic capture (Document or Face)
<strong>BiometridStandard.getInstance().startAutoCapture(viewController: self, options: options, callback: self)
</strong>// Starts mrz code scanner
BiometridStandard.getInstance().startAutoMRZCapture(viewController: self, options: options, callback: self)
</code></pre>

<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 auto capture screen</td></tr><tr><td>options: <strong>CaptureOptions?</strong></td><td>Options to change customization of screen</td></tr><tr><td>callback: <strong>ProcessCallback?</strong></td><td>callback</td></tr></tbody></table>

## Implementation example

```swift
import UIKit
import BiometridStandardSDK
import AutoCaptureWrapper

class ViewController: UIViewController, ProcessCallback {
    
    override func viewDidLoad() {
        super.viewDidLoad()
    }
    
    @IBAction func startAutoCaptureBtn(_ sender: Any) {
        let options = CaptureOptions()
        BiometridStandard.getInstance().startAutoCapture(viewController: self, options: options, callback: self)
    }
    
    func autoCaptureCallback(status: Bool, result: CaptureResult?, error: Errors?) {
        if !status || error != nil {
            print(error?.rawValue)
            return
        }
        print("result", result.image64)
    }
}
```

## Callback params

<table><thead><tr><th width="228">Parameter</th><th>Description</th></tr></thead><tbody><tr><td>status: <strong>Bool</strong></td><td>Method request status</td></tr><tr><td>result: <strong>CaptureResult?</strong></td><td>Class with result image of auto capture</td></tr><tr><td>error: <strong>Errors?</strong></td><td>Errors associated enum</td></tr></tbody></table>
