Updating to 4.0
What’s new?
Multi-page support
Documents with multiple pages are now supported, being possible to capture several pages to get the analysis results. To enable it (disabled by default) set the GiniConfiguration.multipageEnabled
property to true
.
Besides, when using the Component API, the MultipageReviewViewController
component can be used to handle one or several documents (see the Example app for implementation details).
Networking implementation
The Screen API now offers the option to include all the networking logic, only being necessary to provide a GiniVisionResultsDelegate
when initializing the Screen API in order to get the analysis results.
If you want to migrate your Screen API implementation to this one, just remove your current implementation of the GiniVisionDelegate
and implement the GiniVisionResultsDelegate
. You need to add the Networking
or Networking+Pinning
subspec in your Podfile
before, as pointed out in the Integration guide.
Custom photos gallery
A custom photos gallery picker has been designed, which unlike the native UIImagePickerController
allows to select multiple photos at the same time, to start caching before showing it (no delays when showing the first time) and some additional customization. It is used within the DocumentPickerCoordinator
.
Gini iOS SDK 1.0
In order to use the new Multi-page feature you have to update the Gini iOS SDK to version 1.0, which uses a different way of handling the document analysis, introducing Partial and Composite documents.
Breaking Changes
Bolts
In order to use the new Multi-page feature, you have to update the Gini iOS SDK to version 1.0 which uses the latest version of Bolts (1.9). This version introduces a lot of improvements and bug fixes, but also some breaking changes in the syntaxis.
continue()
is nowcontinueWith(block:)
continue(successBlock:)
is nowcontinueOnSuccessWith(block:)
- And now every
BFTask
has a specific type for the result,BFTask<ResultType>
. i.e:BFTask<GINIDocument>
Screen API only
GiniVisionDelegate
GiniVisionDelegate.didCapture(_:)
andGiniVisionDelegate.didCapture(document:)
are replaced byGiniVisionDelegate.didCapture(document:networkDelegate:)
.GiniVisionDelegate.didReview(_:withChanges:)
andGiniVisionDelegate.didReview(document:withChanges:)
are replaced byGiniVisionDelegate.didReview(documents:networkDelegate:)
.GiniVisionDelegate.didCancelReview()
is replaced byGiniVisionDelegate.didCancelReview(for:)
.GiniVisionDelegate.didShowAnalysis(_:)
is not used anymore.
Component API only
This version adds new screens and new features to old screens, adding also
more complexity to them. That is why now every screen of the Gini Vision Library has a delegate
to handle every interaction from the outside, making the communication with it more extensible and clearer.
Camera screen
- To improve the navigation between screens, the file import pickers has been decoupled from the
CameraViewController
and they are now handled by aDocumentPickerCoordinator
. From now on, you have to use theCameraViewController.init(giniConfiguration:)
initializer and set theCameraViewControllerDelegate
to get the selected picker in theCameraViewControllerDelegate.camera(_:didSelect:)
method. - Now document validation should be handled outside of the
CameraViewController
. - To enable Drag&Drop, just call the
DocumentPickerCoordinator.setupDragAndDrop(in:)
method, passing the view that will handle the drop interaction (we recommend to pass theCameraViewController.view
). - With the addition of a custom image picker to support multiple selection, you can start caching the album images by calling the
DocumentPickerCoordinator.startCaching()
method when creating the coordinator, but only if the gallery access permission has been granted before (DocumentPickerCoordinator.isGalleryPermissionGranted
).