diff --git a/Package.swift b/Package.swift index 0c5756c..8472dcc 100644 --- a/Package.swift +++ b/Package.swift @@ -16,7 +16,7 @@ let package = Package( dependencies: [ // Dependencies declare other packages that this package depends on. // .package(url: /* package url */, from: "1.0.0"), - .package(name: "GiniBankAPILibrary", url: "https://github.com/gini/bank-api-library-ios.git", .exact("3.3.0")) + .package(name: "GiniBankAPILibrary", url: "https://github.com/gini/bank-api-library-ios.git", .exact("3.3.1")) ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. diff --git a/Sources/GiniCaptureSDK/Core/Custom views/GiniBarButton.swift b/Sources/GiniCaptureSDK/Core/Custom views/GiniBarButton.swift index 147a3e7..28757b7 100644 --- a/Sources/GiniCaptureSDK/Core/Custom views/GiniBarButton.swift +++ b/Sources/GiniCaptureSDK/Core/Custom views/GiniBarButton.swift @@ -193,14 +193,14 @@ public final class GiniBarButton { return attributes } - public func setContentHuggingPriority(_ priority: UILayoutPriority, + public func setContentHuggingPriority(_ priority: UILayoutPriority, for axis: NSLayoutConstraint.Axis) { stackView.setContentHuggingPriority(priority, for: axis) titleLabel.setContentHuggingPriority(priority, for: axis) imageView.setContentHuggingPriority(priority, for: axis) } - public func setContentCompressionResistancePriority(_ priority: UILayoutPriority, + public func setContentCompressionResistancePriority(_ priority: UILayoutPriority, for axis: NSLayoutConstraint.Axis) { stackView.setContentCompressionResistancePriority(priority, for: axis) titleLabel.setContentCompressionResistancePriority(priority, for: axis) diff --git a/Sources/GiniCaptureSDK/Core/Custom views/MultilineTitleButton.swift b/Sources/GiniCaptureSDK/Core/Custom views/MultilineTitleButton.swift index 63fb06b..82f98d8 100644 --- a/Sources/GiniCaptureSDK/Core/Custom views/MultilineTitleButton.swift +++ b/Sources/GiniCaptureSDK/Core/Custom views/MultilineTitleButton.swift @@ -15,7 +15,7 @@ import UIKit o that the button's width and height can be adjusted by the Auto Layout system. **/ -public class MultilineTitleButton: UIButton { +public class MultilineTitleButton: GiniCaptureButton { /** `init?(coder:)` is used for creating an instance of the class from a nib file diff --git a/Sources/GiniCaptureSDK/Core/Extensions/UIImage.swift b/Sources/GiniCaptureSDK/Core/Extensions/UIImage.swift index 3ac52ca..6a1020a 100644 --- a/Sources/GiniCaptureSDK/Core/Extensions/UIImage.swift +++ b/Sources/GiniCaptureSDK/Core/Extensions/UIImage.swift @@ -159,20 +159,19 @@ extension UIImage { } } - extension UIImage.Orientation { init(_ cgOrientation: AVCaptureVideoOrientation) { switch cgOrientation { - case .portrait: - self = .up - case .landscapeRight: - self = .right - case .landscapeLeft: - self = .left - case .portraitUpsideDown: - self = .down - @unknown default: - fatalError("Unknown AVCaptureVideoOrientation case encountered") + case .portrait: + self = .up + case .landscapeRight: + self = .right + case .landscapeLeft: + self = .left + case .portraitUpsideDown: + self = .down + @unknown default: + fatalError("Unknown AVCaptureVideoOrientation case encountered") } } } diff --git a/Sources/GiniCaptureSDK/Core/Extensions/UIViewController.swift b/Sources/GiniCaptureSDK/Core/Extensions/UIViewController.swift index 93bfd48..2980b8f 100644 --- a/Sources/GiniCaptureSDK/Core/Extensions/UIViewController.swift +++ b/Sources/GiniCaptureSDK/Core/Extensions/UIViewController.swift @@ -48,7 +48,6 @@ extension UIViewController { cancelActionTitle: cancelActionTitle, confirmActionTitle: confirmActionTitle, confirmAction: positiveAction) - GiniAnalyticsManager.track(event: .errorDialogShown, screenName: .camera, properties: [GiniAnalyticsProperty(key: .errorMessage, value: message)]) diff --git a/Sources/GiniCaptureSDK/Core/GiniConfiguration.swift b/Sources/GiniCaptureSDK/Core/GiniConfiguration.swift index 73ab5bc..c56400c 100644 --- a/Sources/GiniCaptureSDK/Core/GiniConfiguration.swift +++ b/Sources/GiniCaptureSDK/Core/GiniConfiguration.swift @@ -370,6 +370,14 @@ import GiniBankAPILibrary */ public var customMenuItems: [HelpMenuItem] = [] + // MAKR: - Transaction Docs feature + /** + * Indicates whether the Transaction Docs feature is enabled or not. If set to `true`, + * the user will be presented with an alert dialog in the photo payment flow to choose + * whether to attach images or PDFs to the transaction. + */ + public var transactionDocsEnabled: Bool = true + /** Sets the default error logger. It is only used when giniErrorLoggerIsOn is true. @@ -475,6 +483,26 @@ import GiniBankAPILibrary amountToPay: ExtractionAmount) { guard let documentService = documentService else { return } + let updatedExtractions = buildPaymentExtractions(paymentRecipient, + paymentReference, + paymentPurpose, + iban, + bic, + amountToPay) + + documentService.sendFeedback(with: updatedExtractions, updatedCompoundExtractions: nil) + + documentService.resetToInitialState() + self.documentService = nil + } + + private func buildPaymentExtractions(_ paymentRecipient: String, + _ paymentReference: String, + _ paymentPurpose: String, + _ iban: String, + _ bic: String, + _ amountToPay: ExtractionAmount) -> [Extraction] { + let formattedPriceValue = amountToPay.value.stringValue(withDecimalPoint: 2) ?? "\(amountToPay.value)" let amountToPayString = "\(formattedPriceValue)" + ":" + amountToPay.currency.rawValue @@ -508,18 +536,12 @@ import GiniBankAPILibrary entity: "amount", value: amountToPayString, name: "amountToPay") - - let updatedExtractions: [Extraction] = [paymentRecipientExtraction, - paymentReferenceExtraction, - paymentPurposeExtraction, - ibanExtraction, - bicExtraction, - amountExtraction] - - documentService.sendFeedback(with: updatedExtractions, updatedCompoundExtractions: nil) - - documentService.resetToInitialState() - self.documentService = nil + return [paymentRecipientExtraction, + paymentReferenceExtraction, + paymentPurposeExtraction, + ibanExtraction, + bicExtraction, + amountExtraction] } // swiftlint:enable function_parameter_count @@ -566,46 +588,12 @@ import GiniBankAPILibrary amountToPay: ExtractionAmount) { guard let documentService = documentService else { return } - let formattedPriceValue = amountToPay.value.stringValue(withDecimalPoint: 2) ?? "\(amountToPay.value)" - let amountToPayString = "\(formattedPriceValue)" + ":" + amountToPay.currency.rawValue - - let paymentRecipientExtraction = Extraction(box: nil, - candidates: nil, - entity: "companyname", - value: paymentRecipient, - name: "paymentRecipient") - let paymentReferenceExtraction = Extraction(box: nil, - candidates: nil, - entity: "reference", - value: paymentReference, - name: "paymentReference") - let paymentPurposeExtraction = Extraction(box: nil, - candidates: nil, - entity: "text", - value: paymentPurpose, - name: "paymentPurpose") - let ibanExtraction = Extraction(box: nil, - candidates: nil, - entity: "iban", - value: iban, - name: "iban") - let bicExtraction = Extraction(box: nil, - candidates: nil, - entity: "bic", - value: bic, - name: "bic") - let amountExtraction = Extraction(box: nil, - candidates: nil, - entity: "amount", - value: amountToPayString, - name: "amountToPay") - - let updatedExtractions: [Extraction] = [paymentRecipientExtraction, - paymentReferenceExtraction, - paymentPurposeExtraction, - ibanExtraction, - bicExtraction, - amountExtraction] + let updatedExtractions = buildPaymentExtractions(paymentRecipient, + paymentReference, + paymentPurpose, + iban, + bic, + amountToPay) documentService.sendFeedback(with: updatedExtractions, updatedCompoundExtractions: nil) } diff --git a/Sources/GiniCaptureSDK/Core/Helpers/ButtonConfiguration.swift b/Sources/GiniCaptureSDK/Core/Helpers/ButtonConfiguration.swift index 86e52a8..3967b92 100644 --- a/Sources/GiniCaptureSDK/Core/Helpers/ButtonConfiguration.swift +++ b/Sources/GiniCaptureSDK/Core/Helpers/ButtonConfiguration.swift @@ -61,11 +61,22 @@ extension BottomLabelButton { } } -public extension UIButton { +public class GiniCaptureButton: UIButton { + var traitCollectionUpdated: () -> Void = {} + public override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { + traitCollectionUpdated() + } +} + +public extension GiniCaptureButton { func configure(with configuration: ButtonConfiguration) { self.backgroundColor = configuration.backgroundColor self.layer.borderColor = configuration.borderColor.cgColor self.layer.shadowColor = configuration.shadowColor.cgColor + traitCollectionUpdated = { [weak self] in + self?.layer.borderColor = configuration.borderColor.cgColor + self?.layer.shadowColor = configuration.shadowColor.cgColor + } self.setTitleColor(configuration.titleColor, for: .normal) self.setTitleColor(configuration.titleColor, for: .highlighted) self.setTitleColor(configuration.titleColor, for: .selected) diff --git a/Sources/GiniCaptureSDK/Core/Helpers/GiniCaptureUtils.swift b/Sources/GiniCaptureSDK/Core/Helpers/GiniCaptureUtils.swift index f3d2ed9..06ba201 100644 --- a/Sources/GiniCaptureSDK/Core/Helpers/GiniCaptureUtils.swift +++ b/Sources/GiniCaptureSDK/Core/Helpers/GiniCaptureUtils.swift @@ -2,7 +2,6 @@ // GiniCaptureUtils.swift // GiniCapture // -// Created by Peter Pult on 15/06/16. // Copyright © 2016 Gini GmbH. All rights reserved. // @@ -14,9 +13,9 @@ public func giniCaptureBundle() -> Bundle { /** Returns an optional `UIImage` instance with the given `name` preferably from the client's bundle. - + - parameter name: The name of the image file without file extension. - + - returns: Image if found with name. */ public func UIImageNamedPreferred(named name: String) -> UIImage? { @@ -39,9 +38,9 @@ public func UIImageNamedPreferred(named name: String) -> UIImage? { /** Returns an optional `UIColor` instance with the given `name` preferably from the client's bundle. - + - parameter name: The name of the UIColor from `GiniColors` asset catalog. - + - returns: color if found with name. */ public func UIColorPreferred(named name: String) -> UIColor { @@ -84,10 +83,10 @@ public func UIColorPreferredByProvider(named name: String) -> UIColor { /** Returns a localized string resource preferably from the client's bundle. - + - parameter key: The key to search for in the strings file. - parameter comment: The corresponding comment. - + - returns: String resource for the given key. */ public func NSLocalizedStringPreferredFormat(_ key: String, @@ -106,7 +105,7 @@ public func NSLocalizedStringPreferredFormat(_ key: String, fallbackKey: fallbackKey, comment: comment, bundle: customBundle) { - + return clientLocalizedStringCustomBundle } } @@ -118,7 +117,7 @@ private func giniLocalizedString(_ key: String, fallbackKey: String, comment: String) -> String { let giniBundle = giniCaptureBundle() - + var defaultFormat = NSLocalizedString(key, bundle: giniBundle, comment: comment) @@ -141,7 +140,7 @@ private func clientLocalizedString(_ key: String, var fallbackClientString = NSLocalizedString(fallbackKey, bundle: bundle, comment: comment) - + if let localizedResourceName = GiniConfiguration.shared.localizedStringsTableName { clientString = NSLocalizedString(key, tableName: localizedResourceName, @@ -152,11 +151,12 @@ private func clientLocalizedString(_ key: String, bundle: bundle, comment: comment) } - - guard (clientString.lowercased() != key.lowercased() || fallbackClientString.lowercased() != fallbackKey.lowercased()) else { + + guard clientString.lowercased() != key.lowercased() + || fallbackClientString.lowercased() != fallbackKey.lowercased() else { return nil } - + return clientString } @@ -225,7 +225,7 @@ public class Constraints { } /** - Measure the time spent executing a block + Measure the time spent executing a block */ func measure(block: () -> Void) { diff --git a/Sources/GiniCaptureSDK/Core/Models/GiniCaptureDocument.swift b/Sources/GiniCaptureSDK/Core/Models/GiniCaptureDocument.swift index d924301..bdd5de0 100644 --- a/Sources/GiniCaptureSDK/Core/Models/GiniCaptureDocument.swift +++ b/Sources/GiniCaptureSDK/Core/Models/GiniCaptureDocument.swift @@ -121,7 +121,10 @@ private extension GiniCaptureDocumentBuilder { self.data = data } - override func writeContents(_ contents: Any, to url: URL, for saveOperation: UIDocument.SaveOperation, originalContentsURL: URL?) throws { + override func writeContents(_ contents: Any, + to url: URL, + for saveOperation: UIDocument.SaveOperation, + originalContentsURL: URL?) throws { if (contents as? Data) == nil, (contents as? FileWrapper) == nil { throw DocumentError.unrecognizedContent } diff --git a/Sources/GiniCaptureSDK/Core/Screens/Camera/Camera.swift b/Sources/GiniCaptureSDK/Core/Screens/Camera/Camera.swift index d5c265c..3268c68 100644 --- a/Sources/GiniCaptureSDK/Core/Screens/Camera/Camera.swift +++ b/Sources/GiniCaptureSDK/Core/Screens/Camera/Camera.swift @@ -367,7 +367,8 @@ fileprivate extension Camera { // Configure video data output. videoDataOutput.alwaysDiscardsLateVideoFrames = true videoDataOutput.setSampleBufferDelegate(self, queue: videoDataOutputQueue) - videoDataOutput.videoSettings = [kCVPixelBufferPixelFormatTypeKey as String: kCVPixelFormatType_420YpCbCr8BiPlanarFullRange] + let videoSettings = [kCVPixelBufferPixelFormatTypeKey as String: kCVPixelFormatType_420YpCbCr8BiPlanarFullRange] + videoDataOutput.videoSettings = videoSettings if !session.canAddOutput(videoDataOutput) { for output in session.outputs { session.removeOutput(output) @@ -402,8 +403,8 @@ fileprivate extension Camera { for result in extractIBANS(string: candidate.string) { let ibanRectTransformed = visionResult.boundingBox.applying(visionToAVFTransform) if let videoPreviewLayer = videoPreviewLayer, let regionOfInterest = regionOfInterest { - let convertedRect = videoPreviewLayer.layerRectConverted(fromMetadataOutputRect: ibanRectTransformed) - if regionOfInterest.contains(convertedRect) { + let newRect = videoPreviewLayer.layerRectConverted(fromMetadataOutputRect: ibanRectTransformed) + if regionOfInterest.contains(newRect) { ibans.insert(result) } } diff --git a/Sources/GiniCaptureSDK/Core/Screens/Camera/Camera/CameraViewController.swift b/Sources/GiniCaptureSDK/Core/Screens/Camera/Camera/CameraViewController.swift index 5d510f6..12cff2a 100644 --- a/Sources/GiniCaptureSDK/Core/Screens/Camera/Camera/CameraViewController.swift +++ b/Sources/GiniCaptureSDK/Core/Screens/Camera/Camera/CameraViewController.swift @@ -577,7 +577,10 @@ final class CameraViewController: UIViewController { self.qrCodeOverLay.isHidden = false self.cameraPreviewViewController.changeQRFrameColor(to: .GiniCapture.success2) } - + + // Voiceover announcement + playVoiceOverMessage(success: true) + // this event is sent once per SDK session since the message can be displayed often in the same session GiniAnalyticsManager.track(event: .qr_code_scanned, screenName: .camera, @@ -596,9 +599,23 @@ final class CameraViewController: UIViewController { self.qrCodeOverLay.isHidden = false self.cameraPreviewViewController.changeQRFrameColor(to: .GiniCapture.warning3) } + + // Voiceover announcement + playVoiceOverMessage(success: false) + sendGiniAnalyticsEventForInvalidQRCode() qrCodeOverLay.configureQrCodeOverlay(withCorrectQrCode: false) } + + private func playVoiceOverMessage(success: Bool) { + // Determine the appropriate message based on success + let message = success + ? NSLocalizedStringPreferredFormat("ginicapture.QRscanning.correct", comment: "QR Detected") + : NSLocalizedStringPreferredFormat("ginicapture.QRscanning.incorrect.title", comment: "Unknown QR") + + // Post the announcement for VoiceOver + UIAccessibility.post(notification: .announcement, argument: message) + } private func sendGiniAnalyticsEventForInvalidQRCode() { guard invalidQRCodeOverlayFirstAppearance else { return } diff --git a/Sources/GiniCaptureSDK/Core/Screens/Document picker/DocumentPickerCoordinator.swift b/Sources/GiniCaptureSDK/Core/Screens/Document picker/DocumentPickerCoordinator.swift index 0364b5c..f0ca066 100644 --- a/Sources/GiniCaptureSDK/Core/Screens/Document picker/DocumentPickerCoordinator.swift +++ b/Sources/GiniCaptureSDK/Core/Screens/Document picker/DocumentPickerCoordinator.swift @@ -166,13 +166,11 @@ public final class DocumentPickerCoordinator: NSObject { */ public func showDocumentPicker(from viewController: UIViewController, device: UIDevice = UIDevice.current) { - let documentPicker = UIDocumentPickerViewController(documentTypes: acceptedDocumentTypes, in: .import) - + let documentPicker = GiniDocumentPickerViewController(documentTypes: acceptedDocumentTypes, in: .import) documentPicker.delegate = self documentPicker.allowsMultipleSelection = giniConfiguration.multipageEnabled documentPicker.view.tintColor = .GiniCapture.accent1 - currentPickerDismissesAutomatically = true currentPickerViewController = documentPicker @@ -197,6 +195,24 @@ public final class DocumentPickerCoordinator: NSObject { // MARK: - Fileprivate methods +/// A UIDocumentPickerViewController that sets navigation bar buttons' tint color to a correct one, instead of using the accent color specified by app +private class GiniDocumentPickerViewController: UIDocumentPickerViewController { + var initialTintColor: UIColor? = navBarInstance.tintColor + + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + Self.navBarInstance.tintColor = .GiniCapture.accent1 + } + override func viewDidDisappear(_ animated: Bool) { + super.viewDidDisappear(animated) + // make sure to revert the tint color, otherwise it will affect document pickers/browsers from the host app + Self.navBarInstance.tintColor = initialTintColor + } + static var navBarInstance: UINavigationBar { + UINavigationBar.appearance(whenContainedInInstancesOf: [UIDocumentBrowserViewController.self]) + } +} + fileprivate extension DocumentPickerCoordinator { func createDocument(fromData dataDictionary: (Data?, String?)) -> GiniCaptureDocument? { guard let data = dataDictionary.0 else { return nil } diff --git a/Sources/GiniCaptureSDK/Core/Screens/Document picker/Gallery/AlbumsPickerTableViewCell.swift b/Sources/GiniCaptureSDK/Core/Screens/Document picker/Gallery/AlbumsPickerTableViewCell.swift index df4b464..6a38987 100644 --- a/Sources/GiniCaptureSDK/Core/Screens/Document picker/Gallery/AlbumsPickerTableViewCell.swift +++ b/Sources/GiniCaptureSDK/Core/Screens/Document picker/Gallery/AlbumsPickerTableViewCell.swift @@ -102,6 +102,7 @@ final class AlbumsPickerTableViewCell: UITableViewCell { albumTitleLabel.font = giniConfiguration.textStyleFonts[.headline] albumSubTitleLabel.font = giniConfiguration.textStyleFonts[.subheadline] + separatorInset = UIEdgeInsets(top: 0, left: Constants.paddingBig, bottom: 0, right: 0) let asset = album.assets[album.assets.count - 1] galleryManager.fetchImage(from: asset, diff --git a/Sources/GiniCaptureSDK/Core/Screens/Document picker/Gallery/AlbumsPickerViewController.swift b/Sources/GiniCaptureSDK/Core/Screens/Document picker/Gallery/AlbumsPickerViewController.swift index 56671a1..07e73ef 100644 --- a/Sources/GiniCaptureSDK/Core/Screens/Document picker/Gallery/AlbumsPickerViewController.swift +++ b/Sources/GiniCaptureSDK/Core/Screens/Document picker/Gallery/AlbumsPickerViewController.swift @@ -37,6 +37,7 @@ final class AlbumsPickerViewController: UIViewController, PHPhotoLibraryChangeOb lazy var albumsTableView: UITableView = { let tableView = UITableView(frame: .zero, style: .plain) + tableView.bounces = false tableView.translatesAutoresizingMaskIntoConstraints = false tableView.dataSource = self tableView.delegate = self @@ -177,6 +178,9 @@ extension AlbumsPickerViewController: UITableViewDataSource { cell?.setUp(with: album, giniConfiguration: giniConfiguration, galleryManager: galleryManager) + if indexPath.row == galleryManager.albums.count - 1 { + cell?.separatorInset = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: .greatestFiniteMagnitude) + } return cell! } diff --git a/Sources/GiniCaptureSDK/Core/Screens/Error/ErrorScreenViewController.swift b/Sources/GiniCaptureSDK/Core/Screens/Error/ErrorScreenViewController.swift index 9add839..1272d22 100644 --- a/Sources/GiniCaptureSDK/Core/Screens/Error/ErrorScreenViewController.swift +++ b/Sources/GiniCaptureSDK/Core/Screens/Error/ErrorScreenViewController.swift @@ -94,8 +94,9 @@ class ErrorScreenViewController: UIViewController { } private func sendAnalyticsScreenShown() { + let documentTypeAnalyticsValue = GiniAnalyticsMapper.documentTypeAnalytics(from: documentType) var eventProperties = [GiniAnalyticsProperty(key: .documentType, - value: GiniAnalyticsMapper.documentTypeAnalytics(from: documentType))] + value: documentTypeAnalyticsValue)] let errorAnalytics = errorType.errorAnalytics() eventProperties.append(GiniAnalyticsProperty(key: .errorType, value: errorAnalytics.type)) diff --git a/Sources/GiniCaptureSDK/Core/Screens/Error/ErrorType.swift b/Sources/GiniCaptureSDK/Core/Screens/Error/ErrorType.swift index e56ae61..799df8e 100644 --- a/Sources/GiniCaptureSDK/Core/Screens/Error/ErrorType.swift +++ b/Sources/GiniCaptureSDK/Core/Screens/Error/ErrorType.swift @@ -66,7 +66,7 @@ import GiniBankAPILibrary ErrorType.errorAnalyticsDictionary[self] = errorAnalytics } - func iconName() -> String { + public func iconName() -> String { switch self { case .connection: return "errorGlobe" @@ -83,7 +83,7 @@ import GiniBankAPILibrary } } - func content() -> String { + public func content() -> String { switch self { case .connection: return NSLocalizedStringPreferredFormat( @@ -116,7 +116,7 @@ import GiniBankAPILibrary } } - func title() -> String { + public func title() -> String { switch self { case .connection: return NSLocalizedStringPreferredFormat( diff --git a/Sources/GiniCaptureSDK/Core/Screens/NoResult/NoResultScreenViewController.swift b/Sources/GiniCaptureSDK/Core/Screens/NoResult/NoResultScreenViewController.swift index 8f752ed..55fe441 100644 --- a/Sources/GiniCaptureSDK/Core/Screens/NoResult/NoResultScreenViewController.swift +++ b/Sources/GiniCaptureSDK/Core/Screens/NoResult/NoResultScreenViewController.swift @@ -117,7 +117,7 @@ final class NoResultScreenViewController: UIViewController { GiniAnalyticsManager.trackScreenShown(screenName: .noResults, properties: eventProperties) } - + override func viewDidLayoutSubviews() { super.viewDidLayoutSubviews() if numberOfButtons > 0 { diff --git a/Sources/GiniCaptureSDK/Core/Screens/Onboarding/OnboardingDataSource.swift b/Sources/GiniCaptureSDK/Core/Screens/Onboarding/OnboardingDataSource.swift index 1c35d7f..dc946b6 100644 --- a/Sources/GiniCaptureSDK/Core/Screens/Onboarding/OnboardingDataSource.swift +++ b/Sources/GiniCaptureSDK/Core/Screens/Onboarding/OnboardingDataSource.swift @@ -72,16 +72,19 @@ class OnboardingDataSource: NSObject, BaseCollectionViewDataSource { let flatPaperPage = OnboardingPage(imageName: DefaultOnboardingPage.flatPaper.imageName, title: DefaultOnboardingPage.flatPaper.title, description: DefaultOnboardingPage.flatPaper.description) + let flatPaperIllustrationAdapter = giniConfiguration.onboardingAlignCornersIllustrationAdapter let flatPaperPageModel = OnboardingPageModel(page: flatPaperPage, - illustrationAdapter: giniConfiguration.onboardingAlignCornersIllustrationAdapter, + illustrationAdapter: flatPaperIllustrationAdapter, analyticsScreen: GiniAnalyticsScreen.onboardingFlatPaper.rawValue) let goodLightingPage = OnboardingPage(imageName: DefaultOnboardingPage.lighting.imageName, title: DefaultOnboardingPage.lighting.title, description: DefaultOnboardingPage.lighting.description) + let goodlightingIllustrationAdapter = giniConfiguration.onboardingLightingIllustrationAdapter + let goodLightingScreenAnalyticValue = GiniAnalyticsScreen.onboardingLighting.rawValue let goodLightingPageModel = OnboardingPageModel(page: goodLightingPage, - illustrationAdapter: giniConfiguration.onboardingLightingIllustrationAdapter, - analyticsScreen: GiniAnalyticsScreen.onboardingLighting.rawValue) + illustrationAdapter: goodlightingIllustrationAdapter, + analyticsScreen: goodLightingScreenAnalyticValue) pageModels = [flatPaperPageModel, goodLightingPageModel] @@ -89,8 +92,9 @@ class OnboardingDataSource: NSObject, BaseCollectionViewDataSource { let multiPage = OnboardingPage(imageName: DefaultOnboardingPage.multipage.imageName, title: DefaultOnboardingPage.multipage.title, description: DefaultOnboardingPage.multipage.description) + let multiPageIllustrationAdapter = giniConfiguration.onboardingMultiPageIllustrationAdapter let multiPageModel = OnboardingPageModel(page: multiPage, - illustrationAdapter: giniConfiguration.onboardingMultiPageIllustrationAdapter, + illustrationAdapter: multiPageIllustrationAdapter, analyticsScreen: GiniAnalyticsScreen.onboardingMultipage.rawValue) pageModels.append(multiPageModel) } @@ -99,8 +103,9 @@ class OnboardingDataSource: NSObject, BaseCollectionViewDataSource { let qrCodePage = OnboardingPage(imageName: DefaultOnboardingPage.qrcode.imageName, title: DefaultOnboardingPage.qrcode.title, description: DefaultOnboardingPage.qrcode.description) + let qrCodeIllustrationAdapter = giniConfiguration.onboardingQRCodeIllustrationAdapter let qrCodePageModel = OnboardingPageModel(page: qrCodePage, - illustrationAdapter: giniConfiguration.onboardingQRCodeIllustrationAdapter, + illustrationAdapter: qrCodeIllustrationAdapter, analyticsScreen: GiniAnalyticsScreen.onboardingQRcode.rawValue) pageModels.append(qrCodePageModel) } diff --git a/Sources/GiniCaptureSDK/Core/Screens/Onboarding/Views/OnboardingBottomNavigationBar.swift b/Sources/GiniCaptureSDK/Core/Screens/Onboarding/Views/OnboardingBottomNavigationBar.swift index 8d14cb3..0c854f0 100644 --- a/Sources/GiniCaptureSDK/Core/Screens/Onboarding/Views/OnboardingBottomNavigationBar.swift +++ b/Sources/GiniCaptureSDK/Core/Screens/Onboarding/Views/OnboardingBottomNavigationBar.swift @@ -10,9 +10,9 @@ import UIKit final class OnboardingBottomNavigationBar: UIView { - @IBOutlet weak var nextButton: UIButton! - @IBOutlet weak var skipButton: UIButton! - @IBOutlet weak var getStarted: UIButton! + @IBOutlet weak var nextButton: GiniCaptureButton! + @IBOutlet weak var skipButton: GiniCaptureButton! + @IBOutlet weak var getStarted: GiniCaptureButton! override func awakeFromNib() { super.awakeFromNib() diff --git a/Sources/GiniCaptureSDK/Core/Screens/Screen API Coordinator/GiniScreenAPICoordinator+Analysis.swift b/Sources/GiniCaptureSDK/Core/Screens/Screen API Coordinator/GiniScreenAPICoordinator+Analysis.swift index 01f078e..f8c9cbb 100644 --- a/Sources/GiniCaptureSDK/Core/Screens/Screen API Coordinator/GiniScreenAPICoordinator+Analysis.swift +++ b/Sources/GiniCaptureSDK/Core/Screens/Screen API Coordinator/GiniScreenAPICoordinator+Analysis.swift @@ -27,9 +27,9 @@ extension GiniScreenAPICoordinator { } // MARK: - ImageAnalysisNoResults screen - +typealias NoResultType = NoResultScreenViewController.NoResultType extension GiniScreenAPICoordinator { - func createImageAnalysisNoResultsScreen(type: NoResultScreenViewController.NoResultType) -> NoResultScreenViewController { + func createImageAnalysisNoResultsScreen(type: NoResultType) -> NoResultScreenViewController { let viewModel: BottomButtonsViewModel let viewController: NoResultScreenViewController switch type { diff --git a/Sources/GiniCaptureSDK/GiniCaptureSDKVersion.swift b/Sources/GiniCaptureSDK/GiniCaptureSDKVersion.swift index 373d35f..b7e111c 100644 --- a/Sources/GiniCaptureSDK/GiniCaptureSDKVersion.swift +++ b/Sources/GiniCaptureSDK/GiniCaptureSDKVersion.swift @@ -5,4 +5,4 @@ // Copyright © 2024 Gini GmbH. All rights reserved. // -public let GiniCaptureSDKVersion = "3.10.0" +public let GiniCaptureSDKVersion = "3.10.1" diff --git a/Sources/GiniCaptureSDK/Networking/DocumentService.swift b/Sources/GiniCaptureSDK/Networking/DocumentService.swift index 8ae8b97..f20682a 100644 --- a/Sources/GiniCaptureSDK/Networking/DocumentService.swift +++ b/Sources/GiniCaptureSDK/Networking/DocumentService.swift @@ -187,13 +187,7 @@ public final class DocumentService: DocumentServiceProtocol { case .failure(let error): let message = "Failed to get layout for document with id: \(document.id) error: \(error)" Log(message: message, event: .error) - DispatchQueue.main.async { - guard !errorOccurred else { return } - errorOccurred = true - DispatchQueue.global().async { - completion(.failure(error)) - } - } + completion(.failure(error)) } } } @@ -210,13 +204,7 @@ public final class DocumentService: DocumentServiceProtocol { case let .failure(error): let message = "Failed to get pages for document with id: \(document.id) error: \(error)" Log(message: message, event: .error) - DispatchQueue.main.async { - guard !errorOccurred else { return } - errorOccurred = true - DispatchQueue.global().async { - completion(.failure(error)) - } - } + completion(.failure(error)) } } } @@ -237,13 +225,7 @@ public final class DocumentService: DocumentServiceProtocol { case .failure(let error): let message = "Failed to get page for document with id: \(document.id) error: \(error)" Log(message: message, event: .error) - DispatchQueue.main.async { - guard !errorOccurred else { return } - errorOccurred = true - DispatchQueue.global().async { - completion(.failure(error)) - } - } + completion(.failure(error)) } } } diff --git a/Sources/GiniCaptureSDK/Resources/AlbumsHeaderView.xib b/Sources/GiniCaptureSDK/Resources/AlbumsHeaderView.xib index 9d7754d..19689f1 100644 --- a/Sources/GiniCaptureSDK/Resources/AlbumsHeaderView.xib +++ b/Sources/GiniCaptureSDK/Resources/AlbumsHeaderView.xib @@ -1,11 +1,10 @@ - + - + - @@ -28,7 +27,6 @@ - @@ -41,9 +39,4 @@ - - - - - diff --git a/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport2.imageset/Contents.json b/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport2.imageset/Contents.json index 5dd298b..4db45fe 100644 --- a/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport2.imageset/Contents.json +++ b/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport2.imageset/Contents.json @@ -1,7 +1,7 @@ { "images" : [ { - "filename" : "Group 76.pdf", + "filename" : "Group 31.pdf", "idiom" : "universal" }, { @@ -11,12 +11,62 @@ "value" : "dark" } ], - "filename" : "Group 46.pdf", + "filename" : "Group 48.pdf", "idiom" : "universal" + }, + { + "filename" : "Group 47.pdf", + "idiom" : "ipad" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "filename" : "Group 46.pdf", + "idiom" : "ipad" + }, + { + "filename" : "Group 83.pdf", + "idiom" : "universal", + "locale" : "de" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "filename" : "Group 81.pdf", + "idiom" : "universal", + "locale" : "de" + }, + { + "filename" : "Group 84.pdf", + "idiom" : "ipad", + "locale" : "de" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "filename" : "Group 82.pdf", + "idiom" : "ipad", + "locale" : "de" } ], "info" : { "author" : "xcode", "version" : 1 + }, + "properties" : { + "localizable" : true, + "preserves-vector-representation" : true } } diff --git a/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport2.imageset/Group 31.pdf b/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport2.imageset/Group 31.pdf new file mode 100644 index 0000000..c90aa4f Binary files /dev/null and b/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport2.imageset/Group 31.pdf differ diff --git a/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport2.imageset/Group 46.pdf b/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport2.imageset/Group 46.pdf index 8cc9496..de5c57e 100644 Binary files a/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport2.imageset/Group 46.pdf and b/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport2.imageset/Group 46.pdf differ diff --git a/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport2.imageset/Group 47.pdf b/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport2.imageset/Group 47.pdf new file mode 100644 index 0000000..b34d4bd Binary files /dev/null and b/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport2.imageset/Group 47.pdf differ diff --git a/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport2.imageset/Group 48.pdf b/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport2.imageset/Group 48.pdf new file mode 100644 index 0000000..5471974 Binary files /dev/null and b/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport2.imageset/Group 48.pdf differ diff --git a/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport2.imageset/Group 76.pdf b/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport2.imageset/Group 76.pdf deleted file mode 100644 index 84776e2..0000000 Binary files a/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport2.imageset/Group 76.pdf and /dev/null differ diff --git a/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport2.imageset/Group 81.pdf b/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport2.imageset/Group 81.pdf new file mode 100644 index 0000000..fb32883 Binary files /dev/null and b/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport2.imageset/Group 81.pdf differ diff --git a/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport2.imageset/Group 82.pdf b/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport2.imageset/Group 82.pdf new file mode 100644 index 0000000..a2294fe Binary files /dev/null and b/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport2.imageset/Group 82.pdf differ diff --git a/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport2.imageset/Group 83.pdf b/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport2.imageset/Group 83.pdf new file mode 100644 index 0000000..a33431d Binary files /dev/null and b/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport2.imageset/Group 83.pdf differ diff --git a/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport2.imageset/Group 84.pdf b/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport2.imageset/Group 84.pdf new file mode 100644 index 0000000..b91dcee Binary files /dev/null and b/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport2.imageset/Group 84.pdf differ diff --git a/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport3.imageset/Contents.json b/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport3.imageset/Contents.json index fb785c4..5ef51b1 100644 --- a/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport3.imageset/Contents.json +++ b/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport3.imageset/Contents.json @@ -1,7 +1,7 @@ { "images" : [ { - "filename" : "Group 44.pdf", + "filename" : "Group 77-2.pdf", "idiom" : "universal" }, { @@ -11,12 +11,31 @@ "value" : "dark" } ], - "filename" : "Group 47.pdf", + "filename" : "Group 77.pdf", "idiom" : "universal" + }, + { + "filename" : "Group 85.pdf", + "idiom" : "universal", + "locale" : "de" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "filename" : "Group 83.pdf", + "idiom" : "universal", + "locale" : "de" } ], "info" : { "author" : "xcode", "version" : 1 + }, + "properties" : { + "localizable" : true } } diff --git a/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport3.imageset/Group 44.pdf b/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport3.imageset/Group 44.pdf deleted file mode 100644 index 9977582..0000000 Binary files a/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport3.imageset/Group 44.pdf and /dev/null differ diff --git a/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport3.imageset/Group 47.pdf b/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport3.imageset/Group 47.pdf deleted file mode 100644 index 10a1c6c..0000000 Binary files a/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport3.imageset/Group 47.pdf and /dev/null differ diff --git a/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport3.imageset/Group 77-2.pdf b/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport3.imageset/Group 77-2.pdf new file mode 100644 index 0000000..9b790b4 Binary files /dev/null and b/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport3.imageset/Group 77-2.pdf differ diff --git a/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport3.imageset/Group 77.pdf b/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport3.imageset/Group 77.pdf new file mode 100644 index 0000000..602fc07 Binary files /dev/null and b/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport3.imageset/Group 77.pdf differ diff --git a/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport3.imageset/Group 83.pdf b/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport3.imageset/Group 83.pdf new file mode 100644 index 0000000..727beda Binary files /dev/null and b/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport3.imageset/Group 83.pdf differ diff --git a/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport3.imageset/Group 85.pdf b/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport3.imageset/Group 85.pdf new file mode 100644 index 0000000..3f9aa1d Binary files /dev/null and b/Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/helpImport3.imageset/Group 85.pdf differ diff --git a/Sources/GiniCaptureSDK/Resources/OnboardingScreen/OnboardingBottomNavigationBar.xib b/Sources/GiniCaptureSDK/Resources/OnboardingScreen/OnboardingBottomNavigationBar.xib index f34aef1..c42399b 100644 --- a/Sources/GiniCaptureSDK/Resources/OnboardingScreen/OnboardingBottomNavigationBar.xib +++ b/Sources/GiniCaptureSDK/Resources/OnboardingScreen/OnboardingBottomNavigationBar.xib @@ -1,9 +1,9 @@ - + - + @@ -18,7 +18,7 @@ - - -