Address Extraction
Declaration
With Camera
With Gallery
To view all the type aliases, go to the SybrinDocumentScanner class
Handling the doneLaunching
, success
, failure
or cancel
callbacks are optional but recommended.
Calling the function
Parameters
Type
Description
UIViewController
The controller you would like to present on.
The document type you would like to scan for.
Handling callback responses
doneLaunching
The doneLaunching
callback will be executed after the view controller has successfully launched, or if the view controller failed to launch.
Parameters:
Type
Description
Bool
true
if the view controller presented successfully; otherwise, false
.
String?
If an error occurs, a message describing the error; otherwise, nil
.
Example:
success
The success
callback will be executed after scanning has finished and the view controller has been dismissed.
Parameters:
Type
Description
An object containing the results of the scanned document.
As explained in Features, the success
callback will always return the specific model but in its parent class form (DataModel). However, this can be casted to the specific model to access that model's specific properties.
This is not required, but is recommended if you would like to access the model's specific properties.
Let's say that you provide the captureWithCamera function with the .AddressExtraction
parameter. The result will be of type AddressDocumentDataModel, but is returned in its parent form DataModel. To access all the data specific to AddressDocumentDataModel you will need to cast the DataModel to that type.
Example:
failure
The failure
callback will be executed after scanning has failed and the view controller has been dismissed.
Parameters:
Type
Description
String?
A message describing the error.
If you would like to report a bug, contact us!
Example:
cancel
The cancel
callback will be executed after the user has dismissed the view controller and before scanning could finish.
Parameters:
None
Example:
Full Example
With Camera
With Gallery
Last updated