GiniVision
@objc
public final class GiniVision : NSObject
Convenience class to interact with the Gini Vision Library.
The Gini Vision Library provides views for capturing, reviewing and analysing documents.
By integrating this library in your application you can allow your users to easily take a picture of a document, review it and - by implementing the necessary callbacks - upload the document for analysis to the Gini API.
The Gini Vision Library can be integrated in two ways, either by using the Screen API or the Component API. The Screen API provides a fully pre-configured navigation controller for easy integration, while the Component API provides single view controllers for advanced integration with more freedom for customization.
Important
When using the Component API we advise you to use a similar flow as suggested in the Screen API. Use theCameraViewController
as an entry point with the OnboardingViewController
presented on
top of it. After capturing let the user review the document with the ReviewViewController
and finally present
the AnalysisViewController
while the user waits for the analysis results.
-
Sets a configuration which is used to customize the look and feel of the Gini Vision Library, for example to change texts and colors displayed to the user.
Declaration
Swift
@objc public class func setConfiguration(_ configuration: GiniConfiguration)
Parameters
configuration
The configuration to set.
-
Returns a view controller which will handle the analysis process.
Note
Screen API only.
Declaration
Swift
@objc public class func viewController(withDelegate delegate: GiniVisionDelegate, importedDocuments: [GiniVisionDocument]? = nil) -> UIViewController
Parameters
delegate
An instance conforming to the
GiniVisionDelegate
protocol.importedDocuments
Documents that come from a source different than
CameraViewController
. There should be either images or one PDF, and they should be validated before calling this method.Return Value
A presentable view controller.
-
Returns a view controller which will handle the analysis process.
Note
Screen API only.
Declaration
Swift
public class func viewController(withDelegate delegate: GiniVisionDelegate, importedDocuments: [GiniVisionDocument]? = nil, trackingDelegate: GiniVisionTrackingDelegate? = nil) -> UIViewController
Parameters
delegate
An instance conforming to the
GiniVisionDelegate
protocol.importedDocuments
Documents that come from a source different than
CameraViewController
. There should be either images or one PDF, and they should be validated before calling this method.trackingDelegate
A delegate object to receive user events
Return Value
A presentable view controller.
-
Returns a view controller which will handle the analysis process.
Note
Screen API only.
Declaration
Swift
@objc public class func viewController(withDelegate delegate: GiniVisionDelegate, importedDocument: GiniVisionDocument? = nil) -> UIViewController
Parameters
delegate
An instance conforming to the
GiniVisionDelegate
protocol.importedDocument
Documents that come from a source different than CameraViewController. There should be either images or one PDF, and they should be validated before calling this method.
Return Value
A presentable view controller.
-
Returns a view controller which will handle the analysis process.
Note
Screen API only.
Declaration
Swift
public class func viewController(withDelegate delegate: GiniVisionDelegate, importedDocument: GiniVisionDocument? = nil, trackingDelegate: GiniVisionTrackingDelegate? = nil) -> UIViewController
Parameters
delegate
An instance conforming to the
GiniVisionDelegate
protocol.importedDocument
Documents that come from a source different than CameraViewController. There should be either images or one PDF, and they should be validated before calling this method.
trackingDelegate
A delegate object to receive user events
Return Value
A presentable view controller.
-
Returns a view controller which will handle the analysis process. Allows to set a custom configuration to change the look and feel of the Gini Vision Library.
Note
Screen API only.
Declaration
Swift
@objc public class func viewController(withDelegate delegate: GiniVisionDelegate, withConfiguration configuration: GiniConfiguration, importedDocument: GiniVisionDocument? = nil) -> UIViewController
Parameters
delegate
An instance conforming to the
GiniVisionDelegate
protocol.configuration
The configuration to set.
importedDocument
Documents that come from a source different than CameraViewController. There should be either images or one PDF, and they should be validated before calling this method.
Return Value
A presentable view controller.
-
Returns a view controller which will handle the analysis process. Allows to set a custom configuration to change the look and feel of the Gini Vision Library.
Note
Screen API only.
Declaration
Swift
public class func viewController(withDelegate delegate: GiniVisionDelegate, withConfiguration configuration: GiniConfiguration, importedDocument: GiniVisionDocument? = nil, trackingDelegate: GiniVisionTrackingDelegate? = nil) -> UIViewController
Parameters
delegate
An instance conforming to the
GiniVisionDelegate
protocol.configuration
The configuration to set.
importedDocument
Documents that come from a source different than CameraViewController. There should be either images or one PDF, and they should be validated before calling this method.
trackingDelegate
A delegate object to receive user events
Return Value
A presentable view controller.
-
Returns the current version of the Gini Vision Library. If there is an error retrieving the version the returned value will be an empty string.
Declaration
Swift
@objc public static var versionString: String { get }
-
Validates a
GiniVisionDocument
with a givenGiniConfiguration
.Throws
DocumentValidationError
if there was an error during the validation.Declaration
Swift
@objc public class func validate(_ document: GiniVisionDocument, withConfig giniConfiguration: GiniConfiguration) throws
-
viewController(withClient:importedDocuments:configuration:resultsDelegate:documentMetadata:api:userApi:trackingDelegate:)
Returns a view controller which will handle the analysis process. It’s the easiest way to get started with the Gini Vision Library as it comes pre-configured and handles all screens and transitions out of the box, including the networking.
Note
Screen API only.
Declaration
Swift
public class func viewController(withClient client: Client, importedDocuments: [GiniVisionDocument]? = nil, configuration: GiniConfiguration, resultsDelegate: GiniVisionResultsDelegate, documentMetadata: Document.Metadata? = nil, api: APIDomain = .default, userApi: UserDomain = .default, trackingDelegate: GiniVisionTrackingDelegate? = nil) -> UIViewController
Parameters
client
GiniClient
with the information needed to enable document analysisresultsDelegate
Results delegate object where you can get the results of the analysis.
configuration
The configuration to set.
documentMetadata
Additional HTTP headers to send when uploading documents
api
The Gini backend API to use. Supply .custom(“domain”) in order to specify a custom domain.
userApi
The Gini user backend API to use. Supply .custom(“domain”) in order to specify a custom domain.
trackingDelegate
A delegate object to receive user events
Return Value
A presentable view controller.
-
Undocumented
Declaration
Swift
public class func removeStoredCredentials(for client: Client) throws