/
Configuration

Configuration

Gini Capture SDK provides various features you can enable. All of them are configured through GiniConfiguration.shared instance. Specifically, the GiniConfiguration is used to configure Gini Capture SDK. For Gini Capture SDK used GiniConfiguration.shared() singleton.

@objc public final class GiniConfiguration : NSObject

The GiniConfiguration class enables customization of Gini Capture SDK’s look and feel. If there are limitations regarding which API can be used, this is clearly stated for the specific attribute.

Text can also be set by using the appropriate keys in a Localizable.strings file in the projects bundle. The library will prefer whatever value is set in the following order: attribute in configuration, key in strings file in project bundle, key in strings file in GiniCapture bundle.

Images can only be set by providing images with the same filename in an assets file or as individual files in the projects bundle. The library will prefer whatever value is set in the following order: asset file in project bundle, asset file in GiniCapture bundle.

If there are conflicting pairs of image and text for an interface element (for example, navigationBarCameraTitleCloseButton) the image will always be preferred, while making sure the accessibility label is set.


Makes configuration internally accessible in all classes of Gini Capture SDK.

public static var shared: GiniConfiguration

Supported document types by Gini Capture SDK.

@objc public enum GiniCaptureImportFileTypes : Int
  • none

    case none
  • pdf

    case pdf
  • pdf_and_images

    case pdf_and_images

General options

Sets custom validations that can be done apart from the default ones (file size, file type…). It should throw a CustomDocumentValidationError error.

@objc public var customDocumentValidations: ((GiniCaptureDocument) -> CustomDocumentValidationResult)

Button configuration options

public lazy var primaryButtonConfiguration: ButtonConfiguration { get set }
public lazy var secondaryButtonConfiguration: ButtonConfiguration { get set }
public lazy var transparentButtonConfiguration: ButtonConfiguration { get set }
public lazy var cameraControlButtonConfiguration: ButtonConfiguration { get set }
public lazy var addPageButtonConfiguration: ButtonConfiguration { get set }

Camera options

Sets the color of the loading indicator on the camera screen to the specified color.

@objc public var cameraSetupLoadingIndicatorColor: UIColor

Set the types supported by the file import feature. GiniCaptureImportFileTypes.none by default.

@objc public var fileImportSupportedTypes: GiniCaptureImportFileTypes

Indicates whether the flash toggle should be shown on the camera screen.

@objc public var flashToggleEnabled: Bool

When the flash toggle is enabled, this flag indicates if the flash is on by default.

@objc public var flashOnByDefault: Bool

Sets the close button text in the navigation bar on the camera screen.

@objc public var navigationBarCameraTitleCloseButton: String

Sets the help button text in the navigation bar on the camera screen.

@objc public var navigationBarCameraTitleHelpButton: String

Onboarding screens

Sets the continue button text in the navigation bar on the onboarding screen.

@objc public var navigationBarOnboardingTitleContinueButton: String

Indicates whether the onboarding screen should be presented at each start of Gini Capture SDK

@objc public var onboardingShowAtLaunch: Bool

Indicates whether the onboarding screen should be presented at the first start of the Gini Capture SDK. It is advised to do so.

Overwrites onboardingShowAtLaunch for the first launch.

@objc public var onboardingShowAtFirstLaunch: Bool

Sets custom onboarding pages.

For your convenience we provide the OnboardingPage struct.

public var customOnboardingPages: [OnboardingPage]?

Enable/deactivate the bottom navigation bar.

public var bottomNavigationBarEnabled: Bool

Set an adapter implementation to show a custom bottom navigation bar on the help screens.

public var helpNavigationBarBottomAdapter: HelpBottomNavigationBarAdapter?

Set an adapter implementation to show a custom bottom navigation bar on the camera screen.

public var cameraNavigationBarBottomAdapter: CameraBottomNavigationBarAdapter?

Set an adapter implementation to show a custom bottom navigation bar on the review screen.

public var reviewNavigationBarBottomAdapter: ReviewScreenBottomNavigationBarAdapter?

Set an adapter implementation to show a custom bottom navigation bar on the image picker screen.

public var imagePickerNavigationBarBottomAdapter: ImagePickerBottomNavigationBarAdapter?

Set an adapter implementation to show a custom bottom navigation bar on the onboarding screen.

public var onboardingNavigationBarBottomAdapter: OnboardingNavigationBarBottomAdapter?

Set an adapter implementation to show a custom illustration on the “align corners” onboarding page.

public var onboardingAlignCornersIllustrationAdapter: OnboardingIllustrationAdapter?

Set an adapter implementation to show a custom illustration on the “lighting” onboarding page.

public var onboardingLightingIllustrationAdapter: OnboardingIllustrationAdapter?

Set an adapter implementation to show a custom illustration on the “multi-page” onboarding page.

public var onboardingMultiPageIllustrationAdapter: OnboardingIllustrationAdapter?

Set an adapter implementation to show a custom illustration on the “QR code” onboarding page.

public var onboardingQRCodeIllustrationAdapter: OnboardingIllustrationAdapter?

Set an adapter implementation to show a custom loading indicator on the document analysis screen.

public var customLoadingIndicator: CustomLoadingIndicatorAdapter?

Set an adapter implementation to show a custom loading indicator on the buttons which support loading.

public var onButtonLoadingIndicator: OnButtonLoadingIndicatorAdapter?

Sets the back button text in the navigation bar on the review screen. Use this if you only want to show the title.

@objc public var navigationBarReviewTitleBackButton: String

Sets the close button text in the navigation bar on the review screen. Use this if you only want to show the title.

@objc public var navigationBarReviewTitleCloseButton: String

Sets the continue button text in the navigation bar on the review screen.

@objc public var navigationBarReviewTitleContinueButton: String

Analysis options

Sets the back button text in the navigation bar on the analysis screen. Use this if you only want to show the title.

@objc public var navigationBarAnalysisTitleBackButton: String

Help screens

Sets the back button text in the navigation bar on the help menu screen. Use this if you only want to show the title.

@objc public var navigationBarHelpMenuTitleBackToCameraButton: String

Sets the back button text in the navigation bar on the help screen. Use this if you only want to show the title.

@objc public var navigationBarHelpScreenTitleBackToMenuButton: String

Indicates whether the supported format screens should be shown. In case of false, the option won’t be shown in the Help menu.

@objc public var shouldShowSupportedFormatsScreen: Bool

Open with tutorial options

Sets the text of the app name for the Open with tutorial texts.

@objc public var openWithAppNameForTexts: String

Sets if the Drag&Drop step should be shown in the Open with tutorial.

@objc public var shouldShowDragAndDropTutorial: Bool

Set an array of additional custom help menu items . Those items will be presented as table view cells on the help menu screen. By selecting the cell the user will be redirected to the page, which represented by viewController provided by customer during the HelpMenuViewController.Item initialization.

public var customMenuItems: [HelpMenuItem]

Sets if the default error logging implementation is on.

@objc public var giniErrorLoggerIsOn: Bool { get set }

Sets if the custom error logging is implemented.

public var customGiniErrorLoggerDelegate: GiniCaptureErrorLoggerDelegate? { get set }

Should be set if the default name “Localizable.strings” are not used.

public var localizedStringsTableName: String?
@objc public var closeButtonResource: PreferredButtonResource?
@objc public var helpButtonResource: PreferredButtonResource?
@objc public var backToCameraButtonResource: PreferredButtonResource?
@objc public var backToMenuButtonResource: PreferredButtonResource?
@objc public var nextButtonResource: PreferredButtonResource?
@objc public var cancelButtonResource: PreferredButtonResource?

Enables customization of a font for specific text styles. The change affects all screens where a specific text style is used.

public func updateFont(_ font: UIFont, for textStyle: UIFont.TextStyle)

Parameters

font

Font that is going to be assosiated with specific text style. You can use scaled font or scale your font with our util method UIFont.scaledFont(_ font: UIFont, textStyle: UIFont.TextStyle)

textStyle

Constants that describe the preferred styles for fonts. Please, find additional information here

Functions for clean up

public func cleanup(paymentRecipient: String, paymentReference: String, paymentPurpose: String, iban: String, bic: String, amountToPay: ExtractionAmount)

Parameters

paymentRecipient

paymentRecipient description

paymentReference

paymentReference description

iban

iban description

bic

bic description

amountToPay

amountToPay description

Find an example implementation here.

Related content