Legacy customization
This page presents a guide to layout customization in the iOS SDKs:
The Storyboard and xibs approach has been discontinued. Please, use the most current way of customization documented on this page.
View Customization
1. Create in your project a framework for view development, using UIViewController
, either through the viewCode approach or Storyboards and XIBs.
2. Your interface must contain:
A
UIView
that will display the camera preview in real-time (previewView);A Label for viewing SDK messages ("Center your face", for example);
A
UIActivityIndicatorView
or an element to indicate the loading state;A Label for viewing the name of the step ("Face Register", for example);
A Button to close the SDK screen.
3. Link views with the ViewController
4. In the UIViewController
, import the SDK
This guide uses PassiveFaceLiveness as an example, but the logic is replicated for all SDKs.
5. In the viewDidLoad
method, instantiate PassiveFaceLiveness
and PassiveFaceLivenessCustomViewController
. This is where it all happens! :)
PassiveFaceLivenessCustomViewController
Parameters | Type | Description |
|
| Instance created from the builder |
|
| Own class reference |
|
| UIView which will display the camera preview |
6. Overwrite the methods below, making corresponding calls to the PassiveFaceLivenessCustomViewController
:
7. Use the PassiveFaceLivenessCustomViewDelegate
protocol. It will force the implementation of the necessary methods for UI change and SDK response.
8. For the close button, the cancelButtonClick
method must be called. This method triggers the delegate passiveFaceLivenessControllerDidCancel
:
9. Finally, call your ViewController and... Voilà, customized view!
Example
We also have a repository on github that contains a customization example, you can access it here.
Last updated