In the storyboard for the
ViewController class that will capture the id card, add a
CaptureIDCardVideoPreview is a class that is defined in the Smile Identity SDK. It will be used to capture the id card.
To add the
CaptureIDCardVideoPreview in the storyboard do the following steps: .
UIView to a
UIView, and select
CaptureIDCardVideoPreview as the Class. Set the Module to Smile_Identity_SDK, and uncheck the Inherit Module From Target, as the image below shows.
CaptureIDCardVideoPreview as an outlet and name it
previewView Make the
ViewController be a delegate for the capture selfie callbacks
class MyIDCardViewController: UIViewController, CaptureSelfieDelegate
CaptureIDCard variable at the class level
var captureIDCard : CaptureIDCard?
viewWillAppear function and add the following lines. The
previewView is the control that was added the the storyboard.
userTag is the custom user tag. In this example, it is send the default user tag value that is defined in the SmileIDSingleton.
captureIDCard = CaptureIDCard()captureIDCard?.setup(captureIDCardDelegate: self,previewView: previewViewuserTag:SmileIDSingleton.DEFAULT_USER_TAG )self.view.bringSubview(toFront: previewView)AppDelegate.AppUtility.lockOrientation(UIInterfaceOrientationMask.landscapeRight,andRotateTo:UIInterfaceOrientation.landscapeRight)
viewDidAppear function and add the following line.
viewWillAppear function and add the following line.
viewWillDisappear function and add the following line.