> For the complete documentation index, see [llms.txt](https://legacy-docs.usesmileid.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://legacy-docs.usesmileid.com/integration-options/mobile/ios/deprecated-physical-id-card-capture.md).

# (Deprecated) Physical ID Card Capture

{% hint style="info" %}
This class is available from version 2.1.0 it's important that the view controller be locked in potrait mode for the best user experience
{% endhint %}

## Setup

The iD Card capture view `SIDSmartCardView` tries to take the whole screen and has all the views in needs to perform including the guilde layer, torch button and cancel and confirm buttons

### Step 1

Add a UIView to the storyboard view controller and give it a custom class `SIDSmartCardView` from the `Smile_Identity_SDK` module and snap it to make sure it fills the whole screen.

### Step 2

Add the `SIDSmartCardView` as an outlet to the view controller class

### Step 3

Implement the `CaptureIDCardDelegate` in the view controller and implement the three methods as below and their use case is summarised below

```
class YourViewController: UIViewController,
                            CaptureIDCardDelegate {

func onSmartCardViewFrontComplete(previewUIImage: UIImage, faceFound: Bool) {
  //called everytime a successful front of id card capture is done
}

func onSmartCardViewBackComplete(previewUIImage: UIImage) {
  //called everytime a successful back of id card capture is done
}

func onSmartCardViewError(sidError: SIDError) {
  //called when an error occurs during capture
}

func onSmartCardViewClosed() {
  //called when the user closes the SmartCardView by pressing the X
}

}
```

### Step 4

Setup the capture by using the view outlet as below

```
override func viewDidLoad() {
  super.viewDidLoad()
  sIDSmartCardView.setup(captureIDCardDelegate: self, userTag:<THE_TAG_RELATED_TO_THE_JOB>)
}
```

Replace \<THE\_TAG\_RELATED\_TO\_THE\_JOB> with a custom unique tag. By default this will bring up the front of ID Capture

### Step 5 (Optional)

If there is a need to switch capture after capturing front of id you can listen to changes in the onSmartCardViewFrontComplete method as

```

func onSmartCardViewFrontComplete(previewUIImage: UIImage, faceFound: Bool) {
    idCardView.changeCapture(frontCapture: false)
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://legacy-docs.usesmileid.com/integration-options/mobile/ios/deprecated-physical-id-card-capture.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
