@thegrizzlylabs/react-native-genius-scan 5.17.3 → 6.0.0-beta02
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/android/build.gradle +2 -2
- package/android/src/main/java/com/geniusscansdk/reactnative/RNGeniusScanModule.java +12 -10
- package/index.d.ts +7 -7
- package/index.js +1 -1
- package/ios/GSSDK/GSSDK.xcframework/Info.plist +5 -5
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Assets.car +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/DeviceGuru_DeviceGuru.bundle/DeviceList.plist +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/DeviceGuru_DeviceGuru.bundle/Info.plist +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/DeviceGuru_DeviceGuru.bundle/PrivacyInfo.xcprivacy +34 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/GSSDK +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Headers/GSKDefaultLogLevel.h +1 -1
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Headers/GSKDocumentDetector.h +5 -3
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Headers/GSKEnhancementConfiguration.h +0 -8
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Headers/GSKError.h +7 -3
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Headers/GSKLog.h +1 -1
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Headers/GSKLogger.h +1 -1
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Headers/GSKProcessingResult.h +0 -4
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Headers/GSKQuadrangle.h +1 -7
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Headers/GSKReadabilityResult.h +1 -1
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Headers/GSKRotation.h +5 -1
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Headers/GSKScanFlowStructuredData.h +2 -2
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Headers/GSKScanProcessor.h +6 -5
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Headers/GSSDK-Swift.h +459 -344
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Headers/GSSDK.h +0 -6
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Headers/UIImage+GSKUtils.h +12 -3
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Info.plist +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Modules/GSSDK.swiftmodule/arm64-apple-ios.abi.json +19923 -17290
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Modules/GSSDK.swiftmodule/arm64-apple-ios.private.swiftinterface +334 -279
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Modules/GSSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Modules/GSSDK.swiftmodule/arm64-apple-ios.swiftinterface +334 -279
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/ar.lproj/GSSDK.stringsdict +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/da.lproj/GSSDK.stringsdict +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/de.lproj/GSSDK.stringsdict +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/es.lproj/GSSDK.stringsdict +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/fr.lproj/GSSDK.strings +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/fr.lproj/GSSDK.stringsdict +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/he.lproj/GSSDK.stringsdict +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/hu.lproj/GSSDK.stringsdict +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/it.lproj/GSSDK.stringsdict +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/ja.lproj/GSSDK.stringsdict +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/ko.lproj/GSSDK.stringsdict +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/nl.lproj/GSSDK.stringsdict +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/pl.lproj/GSSDK.stringsdict +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/pt-BR.lproj/GSSDK.stringsdict +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/ru.lproj/GSSDK.stringsdict +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/sv.lproj/GSSDK.stringsdict +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/tr.lproj/GSSDK.stringsdict +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/vi.lproj/GSSDK.stringsdict +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/zh-Hans.lproj/GSSDK.stringsdict +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Assets.car +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/DeviceGuru_DeviceGuru.bundle/DeviceList.plist +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/DeviceGuru_DeviceGuru.bundle/Info.plist +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/DeviceGuru_DeviceGuru.bundle/PrivacyInfo.xcprivacy +34 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/GSSDK +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/GSKDefaultLogLevel.h +1 -1
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/GSKDocumentDetector.h +5 -3
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/GSKEnhancementConfiguration.h +0 -8
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/GSKError.h +7 -3
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/GSKLog.h +1 -1
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/GSKLogger.h +1 -1
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/GSKProcessingResult.h +0 -4
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/GSKQuadrangle.h +1 -7
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/GSKReadabilityResult.h +1 -1
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/GSKRotation.h +5 -1
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/GSKScanFlowStructuredData.h +2 -2
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/GSKScanProcessor.h +6 -5
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/GSSDK-Swift.h +932 -702
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/GSSDK.h +0 -6
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/UIImage+GSKUtils.h +12 -3
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Info.plist +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Modules/GSSDK.swiftmodule/arm64-apple-ios-simulator.abi.json +19923 -17290
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Modules/GSSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +334 -279
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Modules/GSSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Modules/GSSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface +334 -279
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Modules/GSSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json +19923 -17290
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Modules/GSSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +334 -279
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Modules/GSSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Modules/GSSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +334 -279
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/ar.lproj/GSSDK.stringsdict +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/da.lproj/GSSDK.stringsdict +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/de.lproj/GSSDK.stringsdict +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/es.lproj/GSSDK.stringsdict +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/fr.lproj/GSSDK.strings +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/fr.lproj/GSSDK.stringsdict +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/he.lproj/GSSDK.stringsdict +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/hu.lproj/GSSDK.stringsdict +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/it.lproj/GSSDK.stringsdict +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/ja.lproj/GSSDK.stringsdict +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/ko.lproj/GSSDK.stringsdict +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/nl.lproj/GSSDK.stringsdict +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/pl.lproj/GSSDK.stringsdict +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/pt-BR.lproj/GSSDK.stringsdict +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/ru.lproj/GSSDK.stringsdict +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/sv.lproj/GSSDK.stringsdict +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/tr.lproj/GSSDK.stringsdict +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/vi.lproj/GSSDK.stringsdict +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/zh-Hans.lproj/GSSDK.stringsdict +0 -0
- package/ios/RNGeniusScan.m +8 -8
- package/package.json +1 -1
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Headers/GSKEditFrameView.h +0 -71
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Headers/GSKEditFrameViewController.h +0 -62
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Headers/GSKEditableFrame.h +0 -68
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Headers/GSKFilterType.h +0 -43
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Headers/GSKMBProgressHUD.h +0 -410
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Headers/GSKShutterView.h +0 -28
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Headers/GSKView.h +0 -70
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/PrivateHeaders/png.h +0 -3358
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/PrivateHeaders/pngconf.h +0 -615
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/PrivateHeaders/pnglibconf.h +0 -233
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/GSKEditFrameView.h +0 -71
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/GSKEditFrameViewController.h +0 -62
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/GSKEditableFrame.h +0 -68
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/GSKFilterType.h +0 -43
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/GSKMBProgressHUD.h +0 -410
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/GSKShutterView.h +0 -28
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/GSKView.h +0 -70
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/PrivateHeaders/png.h +0 -3358
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/PrivateHeaders/pngconf.h +0 -615
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/PrivateHeaders/pnglibconf.h +0 -233
package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/GSSDK-Swift.h
CHANGED
|
@@ -281,9 +281,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
|
|
281
281
|
#if __has_warning("-Watimport-in-framework-header")
|
|
282
282
|
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
|
|
283
283
|
#endif
|
|
284
|
-
@import AVFoundation;
|
|
285
284
|
@import CoreFoundation;
|
|
286
|
-
@import CoreGraphics;
|
|
287
285
|
@import Dispatch;
|
|
288
286
|
@import Foundation;
|
|
289
287
|
@import ObjectiveC;
|
|
@@ -312,14 +310,6 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
|
|
312
310
|
|
|
313
311
|
#if defined(__OBJC__)
|
|
314
312
|
|
|
315
|
-
SWIFT_PROTOCOL("_TtP5GSSDK20CGImageRepresentable_")
|
|
316
|
-
@protocol CGImageRepresentable
|
|
317
|
-
- (CGImageRef _Nullable)CGImageRepresentation SWIFT_WARN_UNUSED_RESULT;
|
|
318
|
-
@end
|
|
319
|
-
|
|
320
|
-
@interface AVCapturePhoto (SWIFT_EXTENSION(GSSDK)) <CGImageRepresentable>
|
|
321
|
-
@end
|
|
322
|
-
|
|
323
313
|
@class NSString;
|
|
324
314
|
/// Entry point of the SDK. Use this to initialize the SDK with your license key.
|
|
325
315
|
SWIFT_CLASS("_TtC5GSSDK3GSK")
|
|
@@ -351,96 +341,212 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _No
|
|
|
351
341
|
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
|
352
342
|
@end
|
|
353
343
|
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
@property (nonatomic,
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
@
|
|
371
|
-
|
|
372
|
-
///
|
|
373
|
-
///
|
|
344
|
+
/// A barcode such as 1D barcodes or QR codes.
|
|
345
|
+
SWIFT_CLASS("_TtC5GSSDK10GSKBarcode")
|
|
346
|
+
@interface GSKBarcode : NSObject
|
|
347
|
+
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
|
|
348
|
+
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
|
|
349
|
+
@end
|
|
350
|
+
|
|
351
|
+
@interface GSKBarcode (SWIFT_EXTENSION(GSSDK))
|
|
352
|
+
- (BOOL)isEqual:(id _Nullable)object SWIFT_WARN_UNUSED_RESULT;
|
|
353
|
+
@end
|
|
354
|
+
|
|
355
|
+
@interface GSKBarcode (SWIFT_EXTENSION(GSSDK))
|
|
356
|
+
@property (nonatomic, readonly) NSUInteger hash;
|
|
357
|
+
@end
|
|
358
|
+
|
|
359
|
+
@class GSKBarcodeScanFlowConfiguration;
|
|
360
|
+
@class UIViewController;
|
|
361
|
+
@class GSKBarcodeScanFlowResult;
|
|
362
|
+
/// A UI flow for scanning barcodes and QR codes using the device camera.
|
|
363
|
+
/// Configure the flow with <code>GSKBarcodeScanFlowConfiguration</code> to select the
|
|
364
|
+
/// barcode types to detect and whether batch mode is enabled. Present it from
|
|
365
|
+
/// a view controller and await a <code>GSKBarcodeScanFlowResult</code> containing the
|
|
366
|
+
/// decoded barcodes.
|
|
374
367
|
/// important:
|
|
375
|
-
///
|
|
376
|
-
/// code
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
///
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
368
|
+
/// Camera access requires <code>NSCameraUsageDescription</code> in
|
|
369
|
+
/// <code>Info.plist</code>.
|
|
370
|
+
SWIFT_CLASS("_TtC5GSSDK18GSKBarcodeScanFlow")
|
|
371
|
+
@interface GSKBarcodeScanFlow : NSObject
|
|
372
|
+
/// Initializes a new barcode scan flow
|
|
373
|
+
/// \param configuration Configuration for the barcode scanning
|
|
374
|
+
///
|
|
375
|
+
- (nonnull instancetype)initWithConfiguration:(GSKBarcodeScanFlowConfiguration * _Nonnull)configuration OBJC_DESIGNATED_INITIALIZER;
|
|
376
|
+
/// Starts the barcode scanning flow by presenting a full-screen camera interface.
|
|
377
|
+
/// This method presents a camera view controller that continuously scans for barcodes and QR codes.
|
|
378
|
+
/// The scanning process respects the code types specified in the flow’s configuration.
|
|
379
|
+
/// The method uses Swift’s async/await pattern, suspending until either:
|
|
380
|
+
/// <ul>
|
|
381
|
+
/// <li>
|
|
382
|
+
/// A barcode is successfully detected (except in batch mode)
|
|
383
|
+
/// </li>
|
|
384
|
+
/// <li>
|
|
385
|
+
/// The user taps the done button (batch mode)
|
|
386
|
+
/// </li>
|
|
387
|
+
/// <li>
|
|
388
|
+
/// The user cancels the operation
|
|
389
|
+
/// </li>
|
|
390
|
+
/// <li>
|
|
391
|
+
/// An error occurs during setup or scanning
|
|
392
|
+
/// </li>
|
|
393
|
+
/// </ul>
|
|
394
|
+
/// The behavior varies based on the configuration’s isBatchModeEnabled:
|
|
395
|
+
/// <ul>
|
|
396
|
+
/// <li>
|
|
397
|
+
/// <code>false</code>: Returns immediately after detecting one or more codes in a single frame
|
|
398
|
+
/// </li>
|
|
399
|
+
/// <li>
|
|
400
|
+
/// <code>true</code>: Collects unique codes over time until the user taps the done button
|
|
401
|
+
/// </li>
|
|
402
|
+
/// </ul>
|
|
403
|
+
/// Example usage:
|
|
404
|
+
/// \code
|
|
405
|
+
/// let flow = GSKBarcodeScanFlow()
|
|
406
|
+
/// do {
|
|
407
|
+
/// let result = try await flow.resultByStarting(fromViewController: self)
|
|
408
|
+
/// print("Scanned codes: \(result.barcodes.map { $0.value })")
|
|
409
|
+
/// } catch GSKScanFlowError.cancellation {
|
|
410
|
+
/// print("User canceled scanning")
|
|
411
|
+
/// } catch {
|
|
412
|
+
/// print("Scanning failed: \(error)")
|
|
413
|
+
/// }
|
|
414
|
+
///
|
|
415
|
+
/// \endcodeimportant:
|
|
416
|
+
/// This method requires camera permissions. Ensure your app’s Info.plist includes
|
|
417
|
+
/// the <code>NSCameraUsageDescription</code> key with an appropriate description.
|
|
418
|
+
/// note:
|
|
419
|
+
/// The camera interface is presented with <code>modalPresentationStyle</code> set to <code>.fullScreen</code>
|
|
420
|
+
/// for an immersive scanning experience.
|
|
421
|
+
/// \param viewController The view controller from which to present the camera interface.
|
|
422
|
+
/// This should typically be the currently visible view controller.
|
|
423
|
+
///
|
|
424
|
+
///
|
|
425
|
+
/// throws:
|
|
426
|
+
///
|
|
427
|
+
/// <ul>
|
|
428
|
+
/// <li>
|
|
429
|
+
/// A <code>GSKScanFlowError</code>
|
|
430
|
+
/// </li>
|
|
431
|
+
/// </ul>
|
|
432
|
+
///
|
|
433
|
+
/// returns:
|
|
434
|
+
/// A <code>GSKBarcodeScanFlowResult</code> containing the detected barcodes with their
|
|
435
|
+
/// decoded values and format types.
|
|
436
|
+
- (void)resultByStartingFromViewController:(UIViewController * _Nonnull)viewController completionHandler:(void (^ _Nonnull)(GSKBarcodeScanFlowResult * _Nullable, NSError * _Nullable))completionHandler;
|
|
388
437
|
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
|
|
389
438
|
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
|
|
390
439
|
@end
|
|
391
440
|
|
|
392
|
-
@class
|
|
393
|
-
@
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
441
|
+
@class NSError;
|
|
442
|
+
@interface GSKBarcodeScanFlow (SWIFT_EXTENSION(GSSDK))
|
|
443
|
+
/// Instantiates a <code>GSKBarcodeScanFlow</code> instance with the provided configuration.
|
|
444
|
+
/// This initializer is only available from Objective-C.
|
|
445
|
+
+ (nonnull instancetype)barcodeScanFlowWithConfiguration:(GSKBarcodeScanFlowConfiguration * _Nonnull)configuration SWIFT_WARN_UNUSED_RESULT;
|
|
446
|
+
/// Starts the barcode scanning flow.
|
|
447
|
+
/// @param viewController The view controller to present the barcode scanning interface from.
|
|
448
|
+
/// @param successBlock A completion block/closure that will be called on the main
|
|
449
|
+
/// thread upon successful completion of the scan flow. It receives a <code>GSKBarcodeScanFlowResult</code> object as
|
|
450
|
+
/// a parameter. This object gives you access to the scanned codes.
|
|
451
|
+
/// @param failureBlock A block/closure called if an error was encountered.
|
|
452
|
+
/// This method is only available from Objective-C.
|
|
453
|
+
- (void)startFromViewController:(UIViewController * _Nonnull)viewController success:(void (^ _Nonnull)(GSKBarcodeScanFlowResult * _Nonnull))successBlock failure:(void (^ _Nonnull)(NSError * _Nonnull))failureBlock;
|
|
397
454
|
@end
|
|
398
455
|
|
|
399
|
-
@
|
|
400
|
-
///
|
|
401
|
-
///
|
|
402
|
-
///
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
///
|
|
406
|
-
///
|
|
407
|
-
///
|
|
408
|
-
|
|
456
|
+
@class UIColor;
|
|
457
|
+
/// Configuration for the UI barcode scanning flow
|
|
458
|
+
/// This class allows customization of which barcode and QR code formats should be detected
|
|
459
|
+
/// during the scanning process. By default, all supported formats are enabled.
|
|
460
|
+
SWIFT_CLASS("_TtC5GSSDK31GSKBarcodeScanFlowConfiguration")
|
|
461
|
+
@interface GSKBarcodeScanFlowConfiguration : NSObject
|
|
462
|
+
/// Whether batch mode is enabled for code detection.
|
|
463
|
+
/// This setting controls how codes are detected and when they are returned:
|
|
464
|
+
/// <ul>
|
|
465
|
+
/// <li>
|
|
466
|
+
/// <code>false</code>: Detect multiple codes simultaneously in a single frame and return immediately (default)
|
|
467
|
+
/// </li>
|
|
468
|
+
/// <li>
|
|
469
|
+
/// <code>true</code>: Collect multiple codes over time before returning when user taps Done
|
|
470
|
+
/// </li>
|
|
471
|
+
/// </ul>
|
|
472
|
+
/// Example:
|
|
473
|
+
/// \code
|
|
474
|
+
/// // Standard mode - return codes immediately (default)
|
|
475
|
+
/// let standardConfig = GSKBarcodeScanFlowConfiguration(isBatchModeEnabled: false)
|
|
476
|
+
///
|
|
477
|
+
/// // Batch mode - collect codes over time
|
|
478
|
+
/// let batchConfig = GSKBarcodeScanFlowConfiguration(isBatchModeEnabled: true)
|
|
479
|
+
///
|
|
480
|
+
/// \endcode
|
|
481
|
+
@property (nonatomic) BOOL isBatchModeEnabled;
|
|
482
|
+
/// The highlight color used for the UI (overlay). Defaults
|
|
483
|
+
/// to <code>.green</code>. For good contrast, we recommend using a bright color.
|
|
484
|
+
@property (nonatomic, strong) UIColor * _Nonnull highlightColor;
|
|
485
|
+
/// The menu color used for the UI. Defaults to <code>nil</code>, meaning that the system
|
|
486
|
+
/// default color will be used (blue on iOS, for example).
|
|
487
|
+
@property (nonatomic, strong) UIColor * _Nullable menuColor;
|
|
488
|
+
/// Creates a new barcode scan flow configuration with default values
|
|
489
|
+
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
|
409
490
|
@end
|
|
410
491
|
|
|
411
|
-
@class
|
|
412
|
-
@
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
492
|
+
@class NSDictionary;
|
|
493
|
+
@interface GSKBarcodeScanFlowConfiguration (SWIFT_EXTENSION(GSSDK))
|
|
494
|
+
/// Create a configuration from a dictionary.
|
|
495
|
+
/// This is used for interfacing with cross-platform plugins but shouldn’t
|
|
496
|
+
/// be used in native projects.
|
|
497
|
+
+ (GSKBarcodeScanFlowConfiguration * _Nullable)configurationWithDictionary:(NSDictionary * _Nonnull)dictionary error:(NSError * _Nullable * _Nullable)error SWIFT_WARN_UNUSED_RESULT;
|
|
498
|
+
/// Create a configuration from JSON data.
|
|
499
|
+
/// This is used for interfacing with cross-platform plugins but shouldn’t
|
|
500
|
+
/// be used in native projects.
|
|
501
|
+
+ (GSKBarcodeScanFlowConfiguration * _Nullable)configurationWithJSON:(NSString * _Nonnull)json error:(NSError * _Nullable * _Nullable)error SWIFT_WARN_UNUSED_RESULT;
|
|
419
502
|
@end
|
|
420
503
|
|
|
421
|
-
/// The
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
///
|
|
504
|
+
/// The result of a barcode scanning flow.
|
|
505
|
+
/// This class encapsulates the successful outcome of a barcode or QR code scanning session,
|
|
506
|
+
/// containing the detected barcode or QR code data.
|
|
507
|
+
SWIFT_CLASS("_TtC5GSSDK24GSKBarcodeScanFlowResult")
|
|
508
|
+
@interface GSKBarcodeScanFlowResult : NSObject
|
|
509
|
+
/// The detected barcodes containing their decoded values and types.
|
|
510
|
+
/// This property provides access to an array of detected codes, each containing
|
|
511
|
+
/// both the string content and format type (e.g., QR code, Code 128, EAN-13, etc.).
|
|
512
|
+
/// <ul>
|
|
513
|
+
/// <li>
|
|
514
|
+
/// For standard mode: Contains all codes detected in a single frame
|
|
515
|
+
/// </li>
|
|
516
|
+
/// <li>
|
|
517
|
+
/// For batch mode: Contains all codes collected over the scanning session
|
|
518
|
+
/// </li>
|
|
519
|
+
/// </ul>
|
|
520
|
+
@property (nonatomic, readonly, copy) NSArray<GSKBarcode *> * _Nonnull barcodes;
|
|
521
|
+
/// Creates a new barcode scan flow result.
|
|
522
|
+
/// \param barcodes The detected barcodes.
|
|
427
523
|
///
|
|
428
|
-
- (nonnull instancetype)
|
|
429
|
-
|
|
430
|
-
|
|
524
|
+
- (nonnull instancetype)initWithBarcodes:(NSArray<GSKBarcode *> * _Nonnull)barcodes OBJC_DESIGNATED_INITIALIZER;
|
|
525
|
+
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
|
|
526
|
+
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
|
|
431
527
|
@end
|
|
432
528
|
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
/// The
|
|
436
|
-
|
|
437
|
-
///
|
|
438
|
-
///
|
|
439
|
-
|
|
440
|
-
///
|
|
441
|
-
///
|
|
442
|
-
|
|
443
|
-
|
|
529
|
+
@interface GSKBarcodeScanFlowResult (SWIFT_EXTENSION(GSSDK))
|
|
530
|
+
/// Returns a dictionary representation of the result
|
|
531
|
+
/// The dictionary contains:
|
|
532
|
+
/// <ul>
|
|
533
|
+
/// <li>
|
|
534
|
+
/// barcodes: An array of code dictionaries, each containing:
|
|
535
|
+
/// <ul>
|
|
536
|
+
/// <li>
|
|
537
|
+
/// value: The decoded string value
|
|
538
|
+
/// </li>
|
|
539
|
+
/// <li>
|
|
540
|
+
/// type: The code type as a string (e.g., “qr”, “code128”)
|
|
541
|
+
/// </li>
|
|
542
|
+
/// </ul>
|
|
543
|
+
/// </li>
|
|
544
|
+
/// </ul>
|
|
545
|
+
@property (nonatomic, readonly, copy) NSDictionary<NSString *, id> * _Nonnull dictionary;
|
|
546
|
+
/// Returns a JSON representation of the result.
|
|
547
|
+
/// See <code>dictionary</code> for an explanation of the JSON data’s structure.
|
|
548
|
+
- (NSString * _Nonnull)json SWIFT_WARN_UNUSED_RESULT;
|
|
549
|
+
@end
|
|
444
550
|
|
|
445
551
|
/// Represents an error raised by the camera session
|
|
446
552
|
typedef SWIFT_ENUM(NSInteger, GSKCameraSessionError, open) {
|
|
@@ -455,83 +561,210 @@ typedef SWIFT_ENUM(NSInteger, GSKCameraSessionError, open) {
|
|
|
455
561
|
GSKCameraSessionErrorWarnLockDevice = -1003,
|
|
456
562
|
};
|
|
457
563
|
|
|
458
|
-
typedef SWIFT_ENUM(NSInteger, GSKCameraSessionFlashStatus, open) {
|
|
459
|
-
GSKCameraSessionFlashStatusAuto = 0,
|
|
460
|
-
GSKCameraSessionFlashStatusOn = 1,
|
|
461
|
-
GSKCameraSessionFlashStatusOff = 2,
|
|
462
|
-
};
|
|
463
|
-
|
|
464
564
|
@class NSCoder;
|
|
465
|
-
@protocol UIViewControllerTransitionCoordinator;
|
|
466
565
|
@class NSBundle;
|
|
467
|
-
/// A
|
|
566
|
+
/// A camera view controller to scan documents or barcodes.
|
|
567
|
+
/// Inherit from this view controller to create a custom scanning experience. Lay out the <code>cameraView</code> as desired:
|
|
568
|
+
/// By default, <code>cameraView</code> fills the entire screen. You can disable its resizing mask
|
|
569
|
+
/// (<code>cameraView.translatesAutoresizingMaskIntoConstraints</code>) and use Auto Layout constraints.
|
|
570
|
+
/// note:
|
|
571
|
+
///
|
|
572
|
+
/// When a photo of a document is taken, whether manually or automatically, the capture session is paused
|
|
573
|
+
/// and a delegate callback (<code>cameraViewController(_:didGenerateScan:)</code>) is called when the photo is ready.
|
|
574
|
+
/// In this callback, you can decide whether to exit the camera view controller (if you just need to scan a
|
|
575
|
+
/// single page), or keep scanning more images (to support a “batch scanning” flow). For the latter scenario,
|
|
576
|
+
/// you will need to resume the camera session (see <code>resume()</code>). You also need to “reveal” the shutter screen
|
|
577
|
+
/// (see <code>hideShutterView(animated:)</code>).
|
|
468
578
|
SWIFT_CLASS("_TtC5GSSDK23GSKCameraViewController")
|
|
469
579
|
@interface GSKCameraViewController : UIViewController
|
|
580
|
+
/// Requests camera access if needed.
|
|
581
|
+
/// This returns immediately when access is already determined. It only shows the system prompt
|
|
582
|
+
/// when access has not been requested yet.
|
|
583
|
+
///
|
|
584
|
+
/// returns:
|
|
585
|
+
/// <code>true</code> when access is authorized.
|
|
586
|
+
+ (void)requestCameraAccessWithCompletionHandler:(void (^ _Nonnull)(BOOL))completionHandler;
|
|
470
587
|
- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER SWIFT_UNAVAILABLE;
|
|
471
|
-
- (nonnull instancetype)initWithCameraSession:(GSKCameraSession * _Nonnull)cameraSession OBJC_DESIGNATED_INITIALIZER;
|
|
472
|
-
@property (nonatomic, readonly) BOOL prefersStatusBarHidden;
|
|
473
|
-
- (void)loadView;
|
|
474
588
|
- (void)viewDidLoad;
|
|
475
589
|
- (void)viewWillAppear:(BOOL)animated;
|
|
476
590
|
- (void)viewWillDisappear:(BOOL)animated;
|
|
477
|
-
|
|
591
|
+
/// Manually trigger a photo.
|
|
592
|
+
/// Use this to handle the user tapping on a “take photo” button, or your own
|
|
593
|
+
/// custom logic to take a photo.
|
|
594
|
+
- (void)takePhoto;
|
|
478
595
|
- (nonnull instancetype)initWithNibName:(NSString * _Nullable)nibNameOrNil bundle:(NSBundle * _Nullable)nibBundleOrNil SWIFT_UNAVAILABLE;
|
|
479
596
|
@end
|
|
480
597
|
|
|
481
|
-
@
|
|
482
|
-
@
|
|
483
|
-
|
|
598
|
+
@interface GSKCameraViewController (SWIFT_EXTENSION(GSSDK))
|
|
599
|
+
@end
|
|
600
|
+
|
|
601
|
+
/// A document detection mode
|
|
602
|
+
/// When detecting a document, the camera controller can just highlight the document, or also
|
|
603
|
+
/// highlight and trigger the photo when the detection is stable enough.
|
|
604
|
+
typedef SWIFT_ENUM(NSInteger, DocumentDetectionMode, open) {
|
|
605
|
+
/// Visual highlighting only.
|
|
606
|
+
/// The camera will detect document edges and provide visual feedback by drawing
|
|
607
|
+
/// a document overlay, but will not automatically capture photos. Users must
|
|
608
|
+
/// manually trigger photo capture.
|
|
609
|
+
DocumentDetectionModeHighlightOnly = 0,
|
|
610
|
+
/// Highlighting with automatic capture.
|
|
611
|
+
/// Similar to <code>highlightOnly</code>, but the camera will automatically take a photo
|
|
612
|
+
/// when a stable document is detected for a sufficient duration. This provides
|
|
613
|
+
/// a hands-free scanning experience.
|
|
614
|
+
DocumentDetectionModeHighlightAndAutoCapture = 1,
|
|
615
|
+
};
|
|
616
|
+
|
|
617
|
+
@interface GSKCameraViewController (SWIFT_EXTENSION(GSSDK))
|
|
484
618
|
@end
|
|
485
619
|
|
|
620
|
+
/// Constants indicating an interruption reason for the camera session.
|
|
621
|
+
typedef SWIFT_ENUM(NSInteger, InterruptionReason, open) {
|
|
622
|
+
/// An interruption caused by the app being sent to the background while using a camera.
|
|
623
|
+
InterruptionReasonVideoDeviceNotAvailableInBackground = 0,
|
|
624
|
+
/// An interruption caused by the audio hardware temporarily being made unavailable, for instance,
|
|
625
|
+
/// for a phone call, or alarm.
|
|
626
|
+
InterruptionReasonAudioDeviceInUseByAnotherClient = 1,
|
|
627
|
+
/// An interruption caused by the video device temporarily being made unavailable, for instance,
|
|
628
|
+
/// when stolen away by another app.
|
|
629
|
+
InterruptionReasonVideoDeviceInUseByAnotherClient = 2,
|
|
630
|
+
/// An interruption caused when the app is running in a multi-app layout, causing resource contention
|
|
631
|
+
/// and degraded recording quality of service. Given your present session configuration, the
|
|
632
|
+
/// session may only be run if your app occupies the full screen.
|
|
633
|
+
InterruptionReasonVideoDeviceNotAvailableWithMultipleForegroundApps = 3,
|
|
634
|
+
/// An interruption caused by the video device temporarily being made unavailable due to system pressure,
|
|
635
|
+
/// such as thermal duress.
|
|
636
|
+
InterruptionReasonVideoDeviceNotAvailableDueToSystemPressure = 4,
|
|
637
|
+
InterruptionReasonUnknown = 5,
|
|
638
|
+
};
|
|
639
|
+
|
|
486
640
|
@interface GSKCameraViewController (SWIFT_EXTENSION(GSSDK))
|
|
487
|
-
///
|
|
488
|
-
- (
|
|
641
|
+
/// Factory method for a camera view controller with document detection.
|
|
642
|
+
/// This is only to be used from Objective-C. From Swift, prefer using <code>init(configuration:)</code> instead.
|
|
643
|
+
/// \param documentDetectionMode The document detection mode.
|
|
644
|
+
///
|
|
645
|
+
/// \param documentOverlayColor The color of the document overlay.
|
|
646
|
+
///
|
|
647
|
+
+ (void)makeCameraViewControllerWithDocumentDetectionMode:(enum DocumentDetectionMode)documentDetectionMode documentOverlayColor:(UIColor * _Nonnull)documentOverlayColor completionHandler:(void (^ _Nonnull)(GSKCameraViewController * _Nullable, NSError * _Nullable))completionHandler;
|
|
489
648
|
@end
|
|
490
649
|
|
|
491
|
-
@class GSKScan;
|
|
492
650
|
@class GSKQuadrangle;
|
|
493
|
-
@
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
- (void)
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
- (void)
|
|
509
|
-
|
|
510
|
-
|
|
651
|
+
@class GSKScan;
|
|
652
|
+
SWIFT_PROTOCOL("_TtP5GSSDK31GSKCameraViewControllerDelegate_")
|
|
653
|
+
@protocol GSKCameraViewControllerDelegate
|
|
654
|
+
@optional
|
|
655
|
+
/// The camera view controller failed with an error.
|
|
656
|
+
/// \param cameraViewController The camera view controller
|
|
657
|
+
///
|
|
658
|
+
/// \param error The encountered error.
|
|
659
|
+
///
|
|
660
|
+
- (void)cameraViewController:(GSKCameraViewController * _Nonnull)cameraViewController didFailWithError:(NSError * _Nonnull)error;
|
|
661
|
+
/// The camera view controller encountered a non-fatal error.
|
|
662
|
+
/// \param cameraViewController The camera view controller
|
|
663
|
+
///
|
|
664
|
+
/// \param error The encountered error.
|
|
665
|
+
///
|
|
666
|
+
- (void)cameraViewController:(GSKCameraViewController * _Nonnull)cameraViewController didEncounterNonCriticalError:(NSError * _Nonnull)error;
|
|
667
|
+
/// The camera view controller started running
|
|
668
|
+
/// \param cameraViewController The camera view controller
|
|
669
|
+
///
|
|
670
|
+
- (void)cameraViewControllerDidStart:(GSKCameraViewController * _Nonnull)cameraViewController;
|
|
671
|
+
/// The camera view controller stopped running
|
|
672
|
+
/// \param cameraViewController The camera view controller
|
|
673
|
+
///
|
|
674
|
+
- (void)cameraViewControllerDidStop:(GSKCameraViewController * _Nonnull)cameraViewController;
|
|
675
|
+
/// The camera view controller was interrupted.
|
|
676
|
+
/// This can happen in various cases, including when the user goes to Split View mode on iPad.
|
|
677
|
+
/// \param cameraViewController The camera view controller
|
|
678
|
+
///
|
|
679
|
+
/// \param reason The reason why the camera view controller was interrupted.
|
|
680
|
+
///
|
|
681
|
+
- (void)cameraViewController:(GSKCameraViewController * _Nonnull)cameraViewController wasInterruptedWithReason:(enum InterruptionReason)reason;
|
|
682
|
+
/// The camera view controller resumes after interruption
|
|
683
|
+
/// \param cameraViewController The camera view controller
|
|
684
|
+
///
|
|
685
|
+
- (void)cameraViewControllerInterruptionDidEnd:(GSKCameraViewController * _Nonnull)cameraViewController;
|
|
686
|
+
/// The camera view controller is still looking for a quadrangle.
|
|
687
|
+
/// This is a general notification about the status of the search: we may or may not have identified
|
|
688
|
+
/// its edges. If you want to act on identified edges, listen to the <code>cameraViewController:didFindDocumentWithQuadrangle:</code>
|
|
689
|
+
/// delegate method.
|
|
690
|
+
/// <ul>
|
|
691
|
+
/// <li>
|
|
692
|
+
/// Parameters:
|
|
693
|
+
/// </li>
|
|
694
|
+
/// <li>
|
|
695
|
+
/// cameraViewController: The camera view controller
|
|
696
|
+
/// </li>
|
|
697
|
+
/// </ul>
|
|
698
|
+
- (void)cameraViewControllerIsSearchingForDocument:(GSKCameraViewController * _Nonnull)cameraViewController;
|
|
699
|
+
/// The camera view controller identified a document in the last frame of the photo stream
|
|
700
|
+
/// \param cameraViewController The camera view controller
|
|
701
|
+
///
|
|
702
|
+
/// \param quadrangle The quadrangle of the document that has been found.
|
|
703
|
+
///
|
|
704
|
+
- (void)cameraViewController:(GSKCameraViewController * _Nonnull)cameraViewController didFindDocumentWithQuadrangle:(GSKQuadrangle * _Nonnull)quadrangle;
|
|
705
|
+
/// The camera view controller couldn’t identify a document in the last frame of the photo stream.
|
|
706
|
+
/// This doesn’t mean that the camera view controller has stopped searching for documents or failed.
|
|
707
|
+
/// It just means no document has been identified. In this case, you want to clear any overlay.
|
|
708
|
+
/// \param cameraViewController The camera view controller
|
|
709
|
+
///
|
|
710
|
+
- (void)cameraViewControllerFailedToFindDocument:(GSKCameraViewController * _Nonnull)cameraViewController;
|
|
711
|
+
/// The camera view controller real-time document detection will soon take the photo of a quadrangle, but if the document
|
|
712
|
+
/// detection is not stable enough, the process can still be
|
|
713
|
+
/// cancelled.
|
|
714
|
+
/// It’s a good time to tell the user to remain stable.
|
|
715
|
+
/// Only called when the document detection is set to .highlightAndAutoCapture.
|
|
716
|
+
/// \param cameraViewController The camera view controller
|
|
717
|
+
///
|
|
718
|
+
- (void)cameraViewControllerPhotoStabilizationDidStart:(GSKCameraViewController * _Nonnull)cameraViewController;
|
|
719
|
+
/// The camera view controller is going to automatically take a photo because the detection was stable enough.
|
|
720
|
+
/// The photo taking is underway and cannot be interrupted at this stage.
|
|
721
|
+
/// \param cameraViewController The camera view controller
|
|
722
|
+
///
|
|
723
|
+
/// \param quadrangle The quadrangle of the document that will be photographed.
|
|
724
|
+
///
|
|
725
|
+
- (void)cameraViewController:(GSKCameraViewController * _Nonnull)cameraViewController willSnapPhotoWithQuadrangle:(GSKQuadrangle * _Nonnull)quadrangle;
|
|
726
|
+
/// The camera view controller just took a photo, but it hasn’t been post-processed it yet
|
|
727
|
+
/// \param cameraViewController The camera view controller
|
|
728
|
+
///
|
|
729
|
+
- (void)cameraViewControllerDidSnapPhoto:(GSKCameraViewController * _Nonnull)cameraViewController;
|
|
730
|
+
/// The camera view controller has finished processing the photo we just took.
|
|
731
|
+
/// \param cameraViewController The camera view controller
|
|
732
|
+
///
|
|
733
|
+
/// \param scan The scan object that has been generated. The image contained in the scan object is the full,
|
|
734
|
+
/// unprocessed image in which the document was detected. Use <code>GSKScanProcessor</code> to process and
|
|
735
|
+
/// warp and enhance the scanned document.
|
|
736
|
+
///
|
|
737
|
+
- (void)cameraViewController:(GSKCameraViewController * _Nonnull)cameraViewController didGenerateScan:(GSKScan * _Nonnull)scan;
|
|
738
|
+
/// Camera view controller has detected barcodes.
|
|
739
|
+
/// \param cameraViewController The camera view controller
|
|
740
|
+
///
|
|
741
|
+
/// \param barcodes The detected barcodes
|
|
742
|
+
///
|
|
743
|
+
- (void)cameraViewController:(GSKCameraViewController * _Nonnull)cameraViewController didFindBarcodes:(NSArray<GSKBarcode *> * _Nonnull)barcodes;
|
|
511
744
|
@end
|
|
512
745
|
|
|
513
746
|
/// The type of document detected by the document finder.
|
|
514
747
|
typedef SWIFT_ENUM(NSInteger, GSKDocumentFinderImageType, closed) {
|
|
515
748
|
/// No document present in the image
|
|
516
749
|
GSKDocumentFinderImageTypeNoDocument = 0,
|
|
517
|
-
/// A document present in the image, but no crop
|
|
750
|
+
/// A document is present in the image, but no crop or perspective correction has been applied.
|
|
518
751
|
GSKDocumentFinderImageTypeUnwarped = 1,
|
|
519
|
-
/// A document present in the image, and crop
|
|
752
|
+
/// A document is present in the image, and crop and perspective correction have been applied.
|
|
520
753
|
GSKDocumentFinderImageTypeWarped = 2,
|
|
521
|
-
/// A document present in the image, crop/perspective correction and
|
|
522
|
-
///
|
|
754
|
+
/// A document is present in the image, and crop/perspective correction and
|
|
755
|
+
/// enhancement have been applied.
|
|
523
756
|
GSKDocumentFinderImageTypeEnhanced = 3,
|
|
524
757
|
};
|
|
525
758
|
|
|
526
759
|
@class GSKPDFDocument;
|
|
527
760
|
@protocol GSKDocumentImageProcessor;
|
|
528
761
|
@class GSKDocumentGeneratorConfiguration;
|
|
529
|
-
/// This class exposes the
|
|
762
|
+
/// This class exposes the capability to generate a PDF or TIFF multi-page document file.
|
|
530
763
|
SWIFT_CLASS("_TtC5GSSDK20GSKDocumentGenerator")
|
|
531
764
|
@interface GSKDocumentGenerator : NSObject
|
|
532
765
|
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
|
533
766
|
/// Generates a document file based on a document model and a generator configuration.
|
|
534
|
-
/// \param document The source document to generate as PDF.
|
|
767
|
+
/// \param document The source document to generate as PDF or TIFF depending on the configuration.
|
|
535
768
|
///
|
|
536
769
|
/// \param imageProcessor An object used to process each source document’s image before inserting it in the resulting document.
|
|
537
770
|
/// Only used when generating a PDF document
|
|
@@ -540,7 +773,7 @@ SWIFT_CLASS("_TtC5GSSDK20GSKDocumentGenerator")
|
|
|
540
773
|
///
|
|
541
774
|
- (BOOL)generate:(GSKPDFDocument * _Nonnull)document imageProcessor:(id <GSKDocumentImageProcessor> _Nonnull)imageProcessor configuration:(GSKDocumentGeneratorConfiguration * _Nonnull)configuration error:(NSError * _Nullable * _Nullable)error;
|
|
542
775
|
/// Generates a document file based on a document model and a generator configuration.
|
|
543
|
-
/// \param document The source document to generate as PDF.
|
|
776
|
+
/// \param document The source document to generate as PDF or TIFF depending on the configuration.
|
|
544
777
|
///
|
|
545
778
|
/// \param configuration The configuration for the document generation.
|
|
546
779
|
///
|
|
@@ -554,7 +787,7 @@ SWIFT_CLASS("_TtC5GSSDK33GSKDocumentGeneratorConfiguration")
|
|
|
554
787
|
@interface GSKDocumentGeneratorConfiguration : NSObject
|
|
555
788
|
+ (GSKDocumentGeneratorConfiguration * _Nonnull)pdfConfigurationWithOutputFilePath:(NSString * _Nonnull)outputFilePath SWIFT_WARN_UNUSED_RESULT;
|
|
556
789
|
+ (GSKDocumentGeneratorConfiguration * _Nonnull)tiffConfigurationWithOutputFilePath:(NSString * _Nonnull)outputFilePath SWIFT_WARN_UNUSED_RESULT;
|
|
557
|
-
/// The output file format of the document generator. Must be .pdf or .
|
|
790
|
+
/// The output file format of the document generator. Must be .pdf or .tiff.
|
|
558
791
|
@property (nonatomic, readonly) enum GSKDocumentGeneratorFileFormat outputFileFormat;
|
|
559
792
|
/// The path where the generated document will be written. The extension will not be validated.
|
|
560
793
|
@property (nonatomic, readonly, copy) NSString * _Nonnull outputFilePath;
|
|
@@ -585,7 +818,7 @@ SWIFT_CLASS("_TtC5GSSDK33GSKDocumentGeneratorConfiguration")
|
|
|
585
818
|
|
|
586
819
|
SWIFT_CLASS("_TtC5GSSDK38GSKDocumentGeneratorDebugConfiguration")
|
|
587
820
|
@interface GSKDocumentGeneratorDebugConfiguration : NSObject
|
|
588
|
-
/// If true, OCR’ed text will visible on the PDF.
|
|
821
|
+
/// If true, OCR’ed text will be visible on the PDF.
|
|
589
822
|
/// Defaults to false. Use this for debug only
|
|
590
823
|
@property (nonatomic, readonly) BOOL isOCRTextShownOnPDF;
|
|
591
824
|
- (nonnull instancetype)initWithIsOCRTextShownOnPDF:(BOOL)isOCRTextShownOnPDF OBJC_DESIGNATED_INITIALIZER;
|
|
@@ -629,6 +862,52 @@ SWIFT_PROTOCOL("_TtP5GSSDK25GSKDocumentImageProcessor_")
|
|
|
629
862
|
- (NSString * _Nullable)process:(NSString * _Nonnull)inputFilePath SWIFT_WARN_UNUSED_RESULT;
|
|
630
863
|
@end
|
|
631
864
|
|
|
865
|
+
@class UIImage;
|
|
866
|
+
@class UIView;
|
|
867
|
+
/// A view controller that displays a scanned image with an interactive quadrangle overlay
|
|
868
|
+
/// for manual cropping and perspective adjustment.
|
|
869
|
+
/// <code>GSKEditFrameViewController</code> presents an image and allows the user to refine the detected
|
|
870
|
+
/// document boundaries by dragging the quadrangle’s corner handles. As the user edits the
|
|
871
|
+
/// quadrangle, changes are reflected in the <code>quadrangle</code> property, which is Key-Value
|
|
872
|
+
/// Observing (KVO) compliant.
|
|
873
|
+
/// The overlay’s appearance—including colors, handle size, transparency, and magnifier
|
|
874
|
+
/// behavior—can be customized through the exposed properties. This view controller is
|
|
875
|
+
/// typically used after automatic document detection, to let the user fine-tune the crop
|
|
876
|
+
/// before further processing (such as perspective correction or export).
|
|
877
|
+
SWIFT_CLASS("_TtC5GSSDK26GSKEditFrameViewController")
|
|
878
|
+
@interface GSKEditFrameViewController : UIViewController
|
|
879
|
+
/// The image on which the quadrangle is overlaid.
|
|
880
|
+
@property (nonatomic, strong) UIImage * _Nonnull image;
|
|
881
|
+
@property (nonatomic, readonly, strong) UIView * _Nonnull frameView;
|
|
882
|
+
/// Used to set the quadrangle to display in the view controller, and to retrieve the new quadrangle edited by the user.
|
|
883
|
+
@property (nonatomic, strong) GSKQuadrangle * _Nonnull quadrangle;
|
|
884
|
+
/// Insets applied around the image.
|
|
885
|
+
/// By default this matches half the quadrangle overlay handle width, so handles remain visible even when
|
|
886
|
+
/// the corners are on the edge of the image.
|
|
887
|
+
@property (nonatomic) CGFloat inset;
|
|
888
|
+
/// Customize the color of the shade within the quadrangle.
|
|
889
|
+
@property (nonatomic, strong) UIColor * _Nonnull shadeColor SWIFT_DEPRECATED_MSG("Deprecated in favor of frameView.imageSelection.insideShadeColor.");
|
|
890
|
+
/// Customize the color of the shade outside the quadrangle.
|
|
891
|
+
@property (nonatomic, strong) UIColor * _Nonnull outsideShadeColor;
|
|
892
|
+
/// Customize the color of the line used to draw the quadrangle.
|
|
893
|
+
@property (nonatomic, strong) UIColor * _Nonnull lineColor;
|
|
894
|
+
/// Customize the width of the corner handles.
|
|
895
|
+
@property (nonatomic) CGFloat handleWidth;
|
|
896
|
+
/// Customize the transparency of the entire overlay
|
|
897
|
+
@property (nonatomic) CGFloat overlayAlpha;
|
|
898
|
+
/// Customize the magnifier center style shown while dragging corners.
|
|
899
|
+
@property (nonatomic) GSKMagnifierViewCenterStyle magnifierViewCenterStyle;
|
|
900
|
+
/// \param image The image on which to draw the quadrangle. This is typically the original photo from the camera.
|
|
901
|
+
///
|
|
902
|
+
/// \param quadrangle The initial quadrangle to display.
|
|
903
|
+
///
|
|
904
|
+
- (nonnull instancetype)initWithImage:(UIImage * _Nonnull)image quadrangle:(GSKQuadrangle * _Nonnull)quadrangle OBJC_DESIGNATED_INITIALIZER;
|
|
905
|
+
- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER SWIFT_UNAVAILABLE;
|
|
906
|
+
- (void)setQuadrangle:(GSKQuadrangle * _Nonnull)quadrangle animated:(BOOL)animated;
|
|
907
|
+
- (void)viewDidLoad;
|
|
908
|
+
- (nonnull instancetype)initWithNibName:(NSString * _Nullable)nibNameOrNil bundle:(NSBundle * _Nullable)nibBundleOrNil SWIFT_UNAVAILABLE;
|
|
909
|
+
@end
|
|
910
|
+
|
|
632
911
|
/// A configuration to specify the background cleaning to apply with GSKScanProcessor.
|
|
633
912
|
SWIFT_CLASS("_TtC5GSSDK40GSKFilterBackgroundCleaningConfiguration")
|
|
634
913
|
@interface GSKFilterBackgroundCleaningConfiguration : NSObject
|
|
@@ -794,6 +1073,12 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) GSKFilterLig
|
|
|
794
1073
|
- (BOOL)isEqual:(id _Nullable)object SWIFT_WARN_UNUSED_RESULT;
|
|
795
1074
|
@end
|
|
796
1075
|
|
|
1076
|
+
typedef SWIFT_ENUM(NSInteger, GSKFlashStatus, open) {
|
|
1077
|
+
GSKFlashStatusAuto = 0,
|
|
1078
|
+
GSKFlashStatusOn = 1,
|
|
1079
|
+
GSKFlashStatusOff = 2,
|
|
1080
|
+
};
|
|
1081
|
+
|
|
797
1082
|
enum GSKIntegrationFramework : NSInteger;
|
|
798
1083
|
SWIFT_CLASS_NAMED("GSKIntegrationContext")
|
|
799
1084
|
@interface GSKIntegrationContext : NSObject
|
|
@@ -833,14 +1118,14 @@ SWIFT_CLASS("_TtC5GSSDK6GSKOCR")
|
|
|
833
1118
|
/// The OCR decides what post-processing to apply for the best results.
|
|
834
1119
|
///
|
|
835
1120
|
/// \param configuration Configuration for the OCR process, in particular the language in which the OCR is
|
|
836
|
-
/// performed. Note that you must
|
|
1121
|
+
/// performed. Note that you must provide the appropriate trained data.
|
|
837
1122
|
///
|
|
838
1123
|
/// \param progressBlock The progress between 0 and 1. Called on the same thread.
|
|
839
1124
|
///
|
|
840
1125
|
///
|
|
841
1126
|
/// returns:
|
|
842
1127
|
/// An OCR result.
|
|
843
|
-
- (void)recognizeTextForImageAtPath:(NSString * _Nonnull)imagePath
|
|
1128
|
+
- (void)recognizeTextForImageAtPath:(NSString * _Nonnull)imagePath configuration:(GSKOCRConfiguration * _Nonnull)configuration onProgress:(void (^ _Nullable)(float))progressBlock completionHandler:(void (^ _Nonnull)(GSKOCRResult * _Nullable, NSError * _Nullable))completionHandler;
|
|
844
1129
|
@end
|
|
845
1130
|
|
|
846
1131
|
/// The configuration for an OCR operation.
|
|
@@ -928,186 +1213,6 @@ SWIFT_CLASS("_TtC5GSSDK10GSKPDFSize")
|
|
|
928
1213
|
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
|
|
929
1214
|
@end
|
|
930
1215
|
|
|
931
|
-
@class GSKReadableCodeFlowConfiguration;
|
|
932
|
-
@class GSKReadableCodeFlowResult;
|
|
933
|
-
/// A flow for scanning readable codes (barcodes, QR codes, etc.)
|
|
934
|
-
SWIFT_CLASS("_TtC5GSSDK19GSKReadableCodeFlow")
|
|
935
|
-
@interface GSKReadableCodeFlow : NSObject
|
|
936
|
-
/// Initializes a new readable code flow
|
|
937
|
-
/// \param configuration Configuration for the readable code scanning
|
|
938
|
-
///
|
|
939
|
-
- (nonnull instancetype)initWithConfiguration:(GSKReadableCodeFlowConfiguration * _Nonnull)configuration OBJC_DESIGNATED_INITIALIZER;
|
|
940
|
-
/// Starts the readable code scanning flow by presenting a full-screen camera interface.
|
|
941
|
-
/// This method presents a camera view controller that continuously scans for barcodes and QR codes.
|
|
942
|
-
/// The scanning process respects the code types specified in the flow’s configuration.
|
|
943
|
-
/// The method uses Swift’s async/await pattern, suspending until either:
|
|
944
|
-
/// <ul>
|
|
945
|
-
/// <li>
|
|
946
|
-
/// A readable code is successfully detected (except in batch mode)
|
|
947
|
-
/// </li>
|
|
948
|
-
/// <li>
|
|
949
|
-
/// The user taps the done button (batch mode)
|
|
950
|
-
/// </li>
|
|
951
|
-
/// <li>
|
|
952
|
-
/// The user cancels the operation
|
|
953
|
-
/// </li>
|
|
954
|
-
/// <li>
|
|
955
|
-
/// An error occurs during setup or scanning
|
|
956
|
-
/// </li>
|
|
957
|
-
/// </ul>
|
|
958
|
-
/// The behavior varies based on the configuration’s isBatchModeEnabled:
|
|
959
|
-
/// <ul>
|
|
960
|
-
/// <li>
|
|
961
|
-
/// <code>false</code>: Returns immediately after detecting one or more codes in a single frame
|
|
962
|
-
/// </li>
|
|
963
|
-
/// <li>
|
|
964
|
-
/// <code>true</code>: Collects unique codes over time until the user taps the done button
|
|
965
|
-
/// </li>
|
|
966
|
-
/// </ul>
|
|
967
|
-
/// Example usage:
|
|
968
|
-
/// \code
|
|
969
|
-
/// let flow = GSKReadableCodeFlow()
|
|
970
|
-
/// do {
|
|
971
|
-
/// let result = try await flow.resultByStarting(fromViewController: self)
|
|
972
|
-
/// print("Scanned codes: \(result.readableCodes.map { $0.value })")
|
|
973
|
-
/// } catch GSKReadableCodeFlowError.userCancellation {
|
|
974
|
-
/// print("User canceled scanning")
|
|
975
|
-
/// } catch {
|
|
976
|
-
/// print("Scanning failed: \(error)")
|
|
977
|
-
/// }
|
|
978
|
-
///
|
|
979
|
-
/// \endcodeimportant:
|
|
980
|
-
/// This method requires camera permissions. Ensure your app’s Info.plist includes
|
|
981
|
-
/// the <code>NSCameraUsageDescription</code> key with an appropriate description.
|
|
982
|
-
/// note:
|
|
983
|
-
/// The camera interface is presented with <code>modalPresentationStyle</code> set to <code>.fullScreen</code>
|
|
984
|
-
/// for an immersive scanning experience.
|
|
985
|
-
/// \param viewController The view controller from which to present the camera interface.
|
|
986
|
-
/// This should typically be the currently visible view controller.
|
|
987
|
-
///
|
|
988
|
-
///
|
|
989
|
-
/// throws:
|
|
990
|
-
///
|
|
991
|
-
/// <ul>
|
|
992
|
-
/// <li>
|
|
993
|
-
/// Typically throws a <code>GSKReadableCodeFlowError</code>
|
|
994
|
-
/// </li>
|
|
995
|
-
/// </ul>
|
|
996
|
-
///
|
|
997
|
-
/// returns:
|
|
998
|
-
/// A <code>GSKReadableCodeFlowResult</code> containing the detected readable codes with their
|
|
999
|
-
/// decoded values and format types.
|
|
1000
|
-
- (void)resultByStartingFromViewController:(UIViewController * _Nonnull)viewController completionHandler:(void (^ _Nonnull)(GSKReadableCodeFlowResult * _Nullable, NSError * _Nullable))completionHandler;
|
|
1001
|
-
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
|
|
1002
|
-
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
|
|
1003
|
-
@end
|
|
1004
|
-
|
|
1005
|
-
@class NSError;
|
|
1006
|
-
@interface GSKReadableCodeFlow (SWIFT_EXTENSION(GSSDK))
|
|
1007
|
-
/// Instantiates a <code>GSKReadableCodeFlow</code> instance with the provided configuration.
|
|
1008
|
-
/// This initializer is only available from Objective-C.
|
|
1009
|
-
+ (nonnull instancetype)readableCodeFlowWithConfiguration:(GSKReadableCodeFlowConfiguration * _Nonnull)configuration SWIFT_WARN_UNUSED_RESULT;
|
|
1010
|
-
/// Starts the readable code scanning flow.
|
|
1011
|
-
/// @param viewController The view controller to present the readable code scanning interface from.
|
|
1012
|
-
/// @param successBlock A completion block/closure that will be called on the main
|
|
1013
|
-
/// thread upon successful completion of the scan flow. It receives a <code>GSKReadableCodeFlowResult</code> object as
|
|
1014
|
-
/// a parameter. This object gives you access to the scanned codes.
|
|
1015
|
-
/// @param failureBlock A block/closure called if an error was encountered.
|
|
1016
|
-
/// This method is only available from Objective-C.
|
|
1017
|
-
- (void)startFromViewController:(UIViewController * _Nonnull)viewController success:(void (^ _Nonnull)(GSKReadableCodeFlowResult * _Nonnull))successBlock failure:(void (^ _Nonnull)(NSError * _Nonnull))failureBlock;
|
|
1018
|
-
@end
|
|
1019
|
-
|
|
1020
|
-
@class UIColor;
|
|
1021
|
-
/// Configuration for the UI readable code scanning flow
|
|
1022
|
-
/// This class allows customization of which barcode and QR code formats should be detected
|
|
1023
|
-
/// during the scanning process. By default, all supported formats are enabled.
|
|
1024
|
-
SWIFT_CLASS("_TtC5GSSDK32GSKReadableCodeFlowConfiguration")
|
|
1025
|
-
@interface GSKReadableCodeFlowConfiguration : NSObject
|
|
1026
|
-
/// Whether batch mode is enabled for code detection.
|
|
1027
|
-
/// This setting controls how codes are detected and when they are returned:
|
|
1028
|
-
/// <ul>
|
|
1029
|
-
/// <li>
|
|
1030
|
-
/// <code>false</code>: Detect multiple codes simultaneously in a single frame and return immediately (default)
|
|
1031
|
-
/// </li>
|
|
1032
|
-
/// <li>
|
|
1033
|
-
/// <code>true</code>: Collect multiple codes over time before returning when user taps Done
|
|
1034
|
-
/// </li>
|
|
1035
|
-
/// </ul>
|
|
1036
|
-
/// Example:
|
|
1037
|
-
/// \code
|
|
1038
|
-
/// // Standard mode - return codes immediately (default)
|
|
1039
|
-
/// let standardConfig = GSKReadableCodeFlowConfiguration(isBatchModeEnabled: false)
|
|
1040
|
-
///
|
|
1041
|
-
/// // Batch mode - collect codes over time
|
|
1042
|
-
/// let batchConfig = GSKReadableCodeFlowConfiguration(isBatchModeEnabled: true)
|
|
1043
|
-
///
|
|
1044
|
-
/// \endcode
|
|
1045
|
-
@property (nonatomic) BOOL isBatchModeEnabled;
|
|
1046
|
-
/// The highlight color used for the UI (overlay). Defaults
|
|
1047
|
-
/// to <code>.green</code>. For good constrast, we recommend using a bright color.
|
|
1048
|
-
@property (nonatomic, strong) UIColor * _Nonnull highlightColor;
|
|
1049
|
-
/// The menu color used for the UI. Defaults to <code>nil</code>, meaning that the system
|
|
1050
|
-
/// default color will be used (blue on iOS, for example).
|
|
1051
|
-
@property (nonatomic, strong) UIColor * _Nullable menuColor;
|
|
1052
|
-
/// Creates a new readable code flow configuration with default values
|
|
1053
|
-
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
|
1054
|
-
@end
|
|
1055
|
-
|
|
1056
|
-
@interface GSKReadableCodeFlowConfiguration (SWIFT_EXTENSION(GSSDK))
|
|
1057
|
-
/// Create a configuration from a dictionary.
|
|
1058
|
-
/// This is used for interfacing with cross-platform plugins but shouldn’t
|
|
1059
|
-
/// be used in native projects.
|
|
1060
|
-
+ (GSKReadableCodeFlowConfiguration * _Nullable)configurationWithDictionary:(NSDictionary * _Nonnull)dictionary error:(NSError * _Nullable * _Nullable)error SWIFT_WARN_UNUSED_RESULT;
|
|
1061
|
-
/// Create a configuration from JSON data.
|
|
1062
|
-
/// This is used for interfacing with cross-platform plugins but shouldn’t
|
|
1063
|
-
/// be used in native projects.
|
|
1064
|
-
+ (GSKReadableCodeFlowConfiguration * _Nullable)configurationWithJSON:(NSString * _Nonnull)json error:(NSError * _Nullable * _Nullable)error SWIFT_WARN_UNUSED_RESULT;
|
|
1065
|
-
@end
|
|
1066
|
-
|
|
1067
|
-
/// Enum that defines various errors that can occur during a readable code flow.
|
|
1068
|
-
typedef SWIFT_ENUM(NSInteger, GSKReadableCodeFlowError, open) {
|
|
1069
|
-
/// User has canceled the readable code flow
|
|
1070
|
-
GSKReadableCodeFlowUserCancelationError SWIFT_COMPILE_NAME("userCancellation") = 0,
|
|
1071
|
-
/// A general error due to a bad configuration parameter
|
|
1072
|
-
GSKReadableCodeFlowConfigurationError SWIFT_COMPILE_NAME("configuration") = 1,
|
|
1073
|
-
/// Camera permission was denied
|
|
1074
|
-
GSKReadableCodeFlowPermissionDeniedError SWIFT_COMPILE_NAME("permissionDenied") = 2,
|
|
1075
|
-
/// Failed to initialize the barcode detector
|
|
1076
|
-
GSKReadableCodeFlowDetectorError SWIFT_COMPILE_NAME("detectorError") = 3,
|
|
1077
|
-
};
|
|
1078
|
-
static NSString * _Nonnull const GSKReadableCodeFlowErrorDomain = @"GSSDK.GSKReadableCodeFlowError";
|
|
1079
|
-
|
|
1080
|
-
/// The result of a readable code scanning flow
|
|
1081
|
-
/// This class encapsulates the successful outcome of a readable code scanning session,
|
|
1082
|
-
/// containing the detected barcode or QR code data.
|
|
1083
|
-
SWIFT_CLASS("_TtC5GSSDK25GSKReadableCodeFlowResult")
|
|
1084
|
-
@interface GSKReadableCodeFlowResult : NSObject
|
|
1085
|
-
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
|
|
1086
|
-
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
|
|
1087
|
-
@end
|
|
1088
|
-
|
|
1089
|
-
@interface GSKReadableCodeFlowResult (SWIFT_EXTENSION(GSSDK))
|
|
1090
|
-
/// Returns a dictionary representation of the result
|
|
1091
|
-
/// The dictionary contains:
|
|
1092
|
-
/// <ul>
|
|
1093
|
-
/// <li>
|
|
1094
|
-
/// readableCodes: An array of code dictionaries, each containing:
|
|
1095
|
-
/// <ul>
|
|
1096
|
-
/// <li>
|
|
1097
|
-
/// value: The decoded string value
|
|
1098
|
-
/// </li>
|
|
1099
|
-
/// <li>
|
|
1100
|
-
/// type: The code type as a string (e.g., “qr”, “code128”)
|
|
1101
|
-
/// </li>
|
|
1102
|
-
/// </ul>
|
|
1103
|
-
/// </li>
|
|
1104
|
-
/// </ul>
|
|
1105
|
-
@property (nonatomic, readonly, copy) NSDictionary<NSString *, id> * _Nonnull dictionary;
|
|
1106
|
-
/// Returns a JSON representation of the result.
|
|
1107
|
-
/// See <code>dictionary</code> for an explanation of the JSON data’s structure.
|
|
1108
|
-
- (NSString * _Nonnull)json SWIFT_WARN_UNUSED_RESULT;
|
|
1109
|
-
@end
|
|
1110
|
-
|
|
1111
1216
|
typedef SWIFT_ENUM(NSInteger, GSKReceiptCategory, open) {
|
|
1112
1217
|
GSKReceiptCategoryGas = 0,
|
|
1113
1218
|
GSKReceiptCategoryTransportation = 1,
|
|
@@ -1126,9 +1231,15 @@ SWIFT_CLASS("_TtC5GSSDK13GSKReceiptVAT")
|
|
|
1126
1231
|
@end
|
|
1127
1232
|
|
|
1128
1233
|
@class GSKScanFlowConfiguration;
|
|
1129
|
-
/// A
|
|
1130
|
-
///
|
|
1131
|
-
///
|
|
1234
|
+
/// A UI-driven scan flow for turning physical documents into processed digital pages.
|
|
1235
|
+
/// Create an instance with <code>GSKScanFlowConfiguration</code> to choose the source
|
|
1236
|
+
/// (camera, photo library, or image URL), multi-page behavior, output format,
|
|
1237
|
+
/// filters, OCR, and structured-data extraction. Present the flow from a view
|
|
1238
|
+
/// controller and await a <code>GSKScanFlowResult</code> with the captured pages and the
|
|
1239
|
+
/// optional multi-page document.
|
|
1240
|
+
/// important:
|
|
1241
|
+
/// If you start a scan flow with the camera, your app must declare the
|
|
1242
|
+
/// <code>NSCameraUsageDescription</code> key in <code>Info.plist</code>.
|
|
1132
1243
|
SWIFT_CLASS("_TtC5GSSDK11GSKScanFlow")
|
|
1133
1244
|
@interface GSKScanFlow : NSObject
|
|
1134
1245
|
- (nonnull instancetype)initWithConfiguration:(GSKScanFlowConfiguration * _Nonnull)configuration OBJC_DESIGNATED_INITIALIZER;
|
|
@@ -1247,17 +1358,29 @@ SWIFT_CLASS("_TtC5GSSDK24GSKScanFlowConfiguration")
|
|
|
1247
1358
|
+ (nullable instancetype)configurationWithJSON:(NSString * _Nonnull)json error:(NSError * _Nullable * _Nullable)error SWIFT_WARN_UNUSED_RESULT;
|
|
1248
1359
|
@end
|
|
1249
1360
|
|
|
1250
|
-
/// Enum that defines various
|
|
1251
|
-
typedef SWIFT_ENUM(NSInteger,
|
|
1361
|
+
/// Enum that defines various numeric error codes that can occur during a scan flow.
|
|
1362
|
+
typedef SWIFT_ENUM(NSInteger, GSKScanFlowErrorCode, open) {
|
|
1252
1363
|
/// User has canceled the scan flow
|
|
1253
|
-
|
|
1254
|
-
/// A general error due to
|
|
1364
|
+
GSKScanFlowCancellationErrorCode SWIFT_COMPILE_NAME("cancellation") = 999,
|
|
1365
|
+
/// A general error due to an incorrect configuration. Verify that your
|
|
1255
1366
|
/// inputs match the API requirements.
|
|
1256
|
-
|
|
1367
|
+
GSKScanFlowConfigurationErrorCode SWIFT_COMPILE_NAME("configuration") = 1000,
|
|
1368
|
+
/// A licensing error. This is a developer error and you should contact the
|
|
1369
|
+
/// Genius Scan SDK support team to make sure you have a valid license key.
|
|
1370
|
+
GSKScanFlowLicensingErrorCode SWIFT_COMPILE_NAME("licensing") = 1001,
|
|
1371
|
+
/// An error that happened while capturing the scans. This can sometimes be recovered
|
|
1372
|
+
/// by restarting the device.
|
|
1373
|
+
GSKScanFlowCaptureErrorCode SWIFT_COMPILE_NAME("capture") = 1002,
|
|
1374
|
+
/// An error caused by low storage space. This can be recovered by cleaning up
|
|
1375
|
+
/// storage space and trying again.
|
|
1376
|
+
GSKScanFlowStorageSpaceErrorCode SWIFT_COMPILE_NAME("storageSpace") = 1003,
|
|
1377
|
+
/// An internal error. This is a catch-all category, and the underlying error will
|
|
1378
|
+
/// give more details.
|
|
1379
|
+
GSKScanFlowInternalErrorCode SWIFT_COMPILE_NAME("internal") = 9999,
|
|
1257
1380
|
};
|
|
1258
1381
|
|
|
1259
1382
|
/// The different possible filters for the scanner UI.
|
|
1260
|
-
///
|
|
1383
|
+
/// Each case maps to a predefined filter configuration except <code>.automatic</code>.
|
|
1261
1384
|
typedef SWIFT_ENUM(NSInteger, GSKScanFlowFilterType, open) {
|
|
1262
1385
|
GSKScanFlowFilterNone SWIFT_COMPILE_NAME("none") = 0,
|
|
1263
1386
|
/// Automatic filter
|
|
@@ -1298,8 +1421,8 @@ typedef SWIFT_ENUM(NSUInteger, GSKScanFlowFlashMode, open) {
|
|
|
1298
1421
|
/// The format of the exported document.
|
|
1299
1422
|
typedef SWIFT_ENUM(NSUInteger, GSKScanFlowMultiPageFormat, open) {
|
|
1300
1423
|
GSKScanFlowNone SWIFT_COMPILE_NAME("none") = 0,
|
|
1301
|
-
GSKScanFlowPDF SWIFT_COMPILE_NAME("
|
|
1302
|
-
GSKScanFlowTIFF SWIFT_COMPILE_NAME("
|
|
1424
|
+
GSKScanFlowPDF SWIFT_COMPILE_NAME("pdf") = 1,
|
|
1425
|
+
GSKScanFlowTIFF SWIFT_COMPILE_NAME("tiff") = 2,
|
|
1303
1426
|
};
|
|
1304
1427
|
|
|
1305
1428
|
/// The configuration for text recognition
|
|
@@ -1338,9 +1461,9 @@ typedef SWIFT_ENUM(NSUInteger, GSKScanFlowPDFPageSize, open) {
|
|
|
1338
1461
|
SWIFT_CLASS("_TtC5GSSDK17GSKScanFlowResult")
|
|
1339
1462
|
@interface GSKScanFlowResult : NSObject
|
|
1340
1463
|
/// Document containing the pages that were scanned during the scan
|
|
1341
|
-
/// flow. The format is specified by <code>multiPageFormat</code> property of
|
|
1342
|
-
/// the
|
|
1343
|
-
///
|
|
1464
|
+
/// flow. The format is specified by the <code>multiPageFormat</code> property of
|
|
1465
|
+
/// the <code>GSKScanFlowConfiguration</code> used for the scan flow. This is <code>nil</code>
|
|
1466
|
+
/// when <code>multiPageFormat</code> is <code>.none</code> or if document generation failed.
|
|
1344
1467
|
@property (nonatomic, copy) NSURL * _Nullable multiPageDocumentURL;
|
|
1345
1468
|
/// The individual scans taken during the scan flow.
|
|
1346
1469
|
/// Each scan object contains both the original and the enhanced scans.
|
|
@@ -1373,7 +1496,7 @@ SWIFT_CLASS("_TtC5GSSDK15GSKScanFlowScan")
|
|
|
1373
1496
|
/// If OCR was performed, the recognized text.
|
|
1374
1497
|
@property (nonatomic, strong) GSKScanFlowOCRResult * _Nullable ocrResult;
|
|
1375
1498
|
/// If structured data extraction was performed, the structured data.
|
|
1376
|
-
@property (nonatomic, strong) GSKScanFlowStructuredDataResult * _Nullable
|
|
1499
|
+
@property (nonatomic, strong) GSKScanFlowStructuredDataResult * _Nullable structuredData;
|
|
1377
1500
|
- (nonnull instancetype)initWithOriginalFilePath:(NSString * _Nonnull)originalFilePath enhancedFilePath:(NSString * _Nonnull)enhancedFilePath OBJC_DESIGNATED_INITIALIZER;
|
|
1378
1501
|
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
|
|
1379
1502
|
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
|
|
@@ -1403,6 +1526,8 @@ SWIFT_CLASS("_TtC5GSSDK31GSKScanFlowStructuredDataResult")
|
|
|
1403
1526
|
/// Present if receipt extraction was requested and a receipt/invoice was
|
|
1404
1527
|
/// successfully extracted, <code>nil</code> otherwise.
|
|
1405
1528
|
@property (nonatomic, strong) GSKStructuredDataReceipt * _Nullable receipt;
|
|
1529
|
+
/// Present if barcode extraction was requested and codes were successfully extracted, empty otherwise.
|
|
1530
|
+
@property (nonatomic, copy) NSArray<GSKBarcode *> * _Nonnull barcodes;
|
|
1406
1531
|
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
|
1407
1532
|
@end
|
|
1408
1533
|
|
|
@@ -1542,23 +1667,19 @@ SWIFT_CLASS("_TtC5GSSDK13GSKTextLayout")
|
|
|
1542
1667
|
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
|
|
1543
1668
|
@end
|
|
1544
1669
|
|
|
1545
|
-
|
|
1670
|
+
/// Converts an OCR text layout into plain text.
|
|
1671
|
+
/// A <code>GSKOCRResult</code> contains both raw text and a <code>GSKTextLayout</code>, which preserves spatial information such as
|
|
1672
|
+
/// bounding boxes and line/word positions. This converter reconstructs the raw text from a <code>GSKTextLayout</code> by
|
|
1673
|
+
/// traversing its bounding boxes in reading order and grouping content into paragraphs.
|
|
1674
|
+
/// Use this when you want to retain only the spatial representation (for highlighting, selection, reflow, etc.)
|
|
1675
|
+
/// and regenerate the plain-text representation on demand, rather than storing both.
|
|
1546
1676
|
SWIFT_CLASS("_TtC5GSSDK28GSKTextLayoutToTextConverter")
|
|
1547
1677
|
@interface GSKTextLayoutToTextConverter : NSObject
|
|
1548
|
-
- (GSKTextLayoutToTextConverterResult * _Nullable)convert:(GSKTextLayout * _Nonnull)textLayout error:(NSError * _Nullable * _Nullable)error SWIFT_WARN_UNUSED_RESULT;
|
|
1549
1678
|
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
|
1550
1679
|
@end
|
|
1551
1680
|
|
|
1552
1681
|
SWIFT_CLASS("_TtC5GSSDK34GSKTextLayoutToTextConverterResult")
|
|
1553
1682
|
@interface GSKTextLayoutToTextConverterResult : NSObject
|
|
1554
|
-
/// The text reconstructed from the text layout.
|
|
1555
|
-
@property (nonatomic, readonly, copy) NSString * _Nonnull text;
|
|
1556
|
-
/// The average word confidence of the recognized text.
|
|
1557
|
-
/// A value between 0 and 100
|
|
1558
|
-
@property (nonatomic, readonly) NSInteger averageWordConfidence;
|
|
1559
|
-
/// The number of words in the recognized text.
|
|
1560
|
-
/// This is the number of words on which the average word confidence has been computed.
|
|
1561
|
-
@property (nonatomic, readonly) NSInteger wordCount;
|
|
1562
1683
|
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
|
|
1563
1684
|
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
|
|
1564
1685
|
@end
|
|
@@ -1571,12 +1692,6 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) GSKUIBackgro
|
|
|
1571
1692
|
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
|
1572
1693
|
@end
|
|
1573
1694
|
|
|
1574
|
-
@interface GSKView (SWIFT_EXTENSION(GSSDK))
|
|
1575
|
-
- (void)startSearchAnimation;
|
|
1576
|
-
- (void)startSnapAnimationWithDuration:(NSTimeInterval)duration;
|
|
1577
|
-
- (void)endSnapAnimation;
|
|
1578
|
-
@end
|
|
1579
|
-
|
|
1580
1695
|
SWIFT_CLASS("_TtC5GSSDK14GSSDKResources")
|
|
1581
1696
|
@interface GSSDKResources : NSObject
|
|
1582
1697
|
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) NSBundle * _Nonnull bundle;)
|
|
@@ -1885,9 +2000,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
|
|
1885
2000
|
#if __has_warning("-Watimport-in-framework-header")
|
|
1886
2001
|
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
|
|
1887
2002
|
#endif
|
|
1888
|
-
@import AVFoundation;
|
|
1889
2003
|
@import CoreFoundation;
|
|
1890
|
-
@import CoreGraphics;
|
|
1891
2004
|
@import Dispatch;
|
|
1892
2005
|
@import Foundation;
|
|
1893
2006
|
@import ObjectiveC;
|
|
@@ -1916,14 +2029,6 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
|
|
1916
2029
|
|
|
1917
2030
|
#if defined(__OBJC__)
|
|
1918
2031
|
|
|
1919
|
-
SWIFT_PROTOCOL("_TtP5GSSDK20CGImageRepresentable_")
|
|
1920
|
-
@protocol CGImageRepresentable
|
|
1921
|
-
- (CGImageRef _Nullable)CGImageRepresentation SWIFT_WARN_UNUSED_RESULT;
|
|
1922
|
-
@end
|
|
1923
|
-
|
|
1924
|
-
@interface AVCapturePhoto (SWIFT_EXTENSION(GSSDK)) <CGImageRepresentable>
|
|
1925
|
-
@end
|
|
1926
|
-
|
|
1927
2032
|
@class NSString;
|
|
1928
2033
|
/// Entry point of the SDK. Use this to initialize the SDK with your license key.
|
|
1929
2034
|
SWIFT_CLASS("_TtC5GSSDK3GSK")
|
|
@@ -1946,105 +2051,221 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _No
|
|
|
1946
2051
|
/// updated to the latest version of your app containing the new keys. If <code>autoRefresh</code> is enabled, the following information is sent to the Genius Scan
|
|
1947
2052
|
/// SDK servers: the current license key, a device-unique UUID, and the current version of the app.
|
|
1948
2053
|
///
|
|
1949
|
-
+ (void)setLicenseKey:(NSString * _Nonnull)licenseKey autoRefresh:(BOOL)autoRefresh;
|
|
1950
|
-
/// Checks that the Genius Scan SDK was correctly initialized with a valid license key.
|
|
2054
|
+
+ (void)setLicenseKey:(NSString * _Nonnull)licenseKey autoRefresh:(BOOL)autoRefresh;
|
|
2055
|
+
/// Checks that the Genius Scan SDK was correctly initialized with a valid license key.
|
|
2056
|
+
///
|
|
2057
|
+
/// throws:
|
|
2058
|
+
/// An error if the license key is invalid or expired.
|
|
2059
|
+
+ (BOOL)checkInitializationAndReturnError:(NSError * _Nullable * _Nullable)error;
|
|
2060
|
+
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
|
2061
|
+
@end
|
|
2062
|
+
|
|
2063
|
+
/// A barcode such as 1D barcodes or QR codes.
|
|
2064
|
+
SWIFT_CLASS("_TtC5GSSDK10GSKBarcode")
|
|
2065
|
+
@interface GSKBarcode : NSObject
|
|
2066
|
+
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
|
|
2067
|
+
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
|
|
2068
|
+
@end
|
|
2069
|
+
|
|
2070
|
+
@interface GSKBarcode (SWIFT_EXTENSION(GSSDK))
|
|
2071
|
+
- (BOOL)isEqual:(id _Nullable)object SWIFT_WARN_UNUSED_RESULT;
|
|
2072
|
+
@end
|
|
2073
|
+
|
|
2074
|
+
@interface GSKBarcode (SWIFT_EXTENSION(GSSDK))
|
|
2075
|
+
@property (nonatomic, readonly) NSUInteger hash;
|
|
2076
|
+
@end
|
|
2077
|
+
|
|
2078
|
+
@class GSKBarcodeScanFlowConfiguration;
|
|
2079
|
+
@class UIViewController;
|
|
2080
|
+
@class GSKBarcodeScanFlowResult;
|
|
2081
|
+
/// A UI flow for scanning barcodes and QR codes using the device camera.
|
|
2082
|
+
/// Configure the flow with <code>GSKBarcodeScanFlowConfiguration</code> to select the
|
|
2083
|
+
/// barcode types to detect and whether batch mode is enabled. Present it from
|
|
2084
|
+
/// a view controller and await a <code>GSKBarcodeScanFlowResult</code> containing the
|
|
2085
|
+
/// decoded barcodes.
|
|
2086
|
+
/// important:
|
|
2087
|
+
/// Camera access requires <code>NSCameraUsageDescription</code> in
|
|
2088
|
+
/// <code>Info.plist</code>.
|
|
2089
|
+
SWIFT_CLASS("_TtC5GSSDK18GSKBarcodeScanFlow")
|
|
2090
|
+
@interface GSKBarcodeScanFlow : NSObject
|
|
2091
|
+
/// Initializes a new barcode scan flow
|
|
2092
|
+
/// \param configuration Configuration for the barcode scanning
|
|
2093
|
+
///
|
|
2094
|
+
- (nonnull instancetype)initWithConfiguration:(GSKBarcodeScanFlowConfiguration * _Nonnull)configuration OBJC_DESIGNATED_INITIALIZER;
|
|
2095
|
+
/// Starts the barcode scanning flow by presenting a full-screen camera interface.
|
|
2096
|
+
/// This method presents a camera view controller that continuously scans for barcodes and QR codes.
|
|
2097
|
+
/// The scanning process respects the code types specified in the flow’s configuration.
|
|
2098
|
+
/// The method uses Swift’s async/await pattern, suspending until either:
|
|
2099
|
+
/// <ul>
|
|
2100
|
+
/// <li>
|
|
2101
|
+
/// A barcode is successfully detected (except in batch mode)
|
|
2102
|
+
/// </li>
|
|
2103
|
+
/// <li>
|
|
2104
|
+
/// The user taps the done button (batch mode)
|
|
2105
|
+
/// </li>
|
|
2106
|
+
/// <li>
|
|
2107
|
+
/// The user cancels the operation
|
|
2108
|
+
/// </li>
|
|
2109
|
+
/// <li>
|
|
2110
|
+
/// An error occurs during setup or scanning
|
|
2111
|
+
/// </li>
|
|
2112
|
+
/// </ul>
|
|
2113
|
+
/// The behavior varies based on the configuration’s isBatchModeEnabled:
|
|
2114
|
+
/// <ul>
|
|
2115
|
+
/// <li>
|
|
2116
|
+
/// <code>false</code>: Returns immediately after detecting one or more codes in a single frame
|
|
2117
|
+
/// </li>
|
|
2118
|
+
/// <li>
|
|
2119
|
+
/// <code>true</code>: Collects unique codes over time until the user taps the done button
|
|
2120
|
+
/// </li>
|
|
2121
|
+
/// </ul>
|
|
2122
|
+
/// Example usage:
|
|
2123
|
+
/// \code
|
|
2124
|
+
/// let flow = GSKBarcodeScanFlow()
|
|
2125
|
+
/// do {
|
|
2126
|
+
/// let result = try await flow.resultByStarting(fromViewController: self)
|
|
2127
|
+
/// print("Scanned codes: \(result.barcodes.map { $0.value })")
|
|
2128
|
+
/// } catch GSKScanFlowError.cancellation {
|
|
2129
|
+
/// print("User canceled scanning")
|
|
2130
|
+
/// } catch {
|
|
2131
|
+
/// print("Scanning failed: \(error)")
|
|
2132
|
+
/// }
|
|
2133
|
+
///
|
|
2134
|
+
/// \endcodeimportant:
|
|
2135
|
+
/// This method requires camera permissions. Ensure your app’s Info.plist includes
|
|
2136
|
+
/// the <code>NSCameraUsageDescription</code> key with an appropriate description.
|
|
2137
|
+
/// note:
|
|
2138
|
+
/// The camera interface is presented with <code>modalPresentationStyle</code> set to <code>.fullScreen</code>
|
|
2139
|
+
/// for an immersive scanning experience.
|
|
2140
|
+
/// \param viewController The view controller from which to present the camera interface.
|
|
2141
|
+
/// This should typically be the currently visible view controller.
|
|
2142
|
+
///
|
|
2143
|
+
///
|
|
2144
|
+
/// throws:
|
|
2145
|
+
///
|
|
2146
|
+
/// <ul>
|
|
2147
|
+
/// <li>
|
|
2148
|
+
/// A <code>GSKScanFlowError</code>
|
|
2149
|
+
/// </li>
|
|
2150
|
+
/// </ul>
|
|
2151
|
+
///
|
|
2152
|
+
/// returns:
|
|
2153
|
+
/// A <code>GSKBarcodeScanFlowResult</code> containing the detected barcodes with their
|
|
2154
|
+
/// decoded values and format types.
|
|
2155
|
+
- (void)resultByStartingFromViewController:(UIViewController * _Nonnull)viewController completionHandler:(void (^ _Nonnull)(GSKBarcodeScanFlowResult * _Nullable, NSError * _Nullable))completionHandler;
|
|
2156
|
+
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
|
|
2157
|
+
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
|
|
2158
|
+
@end
|
|
2159
|
+
|
|
2160
|
+
@class NSError;
|
|
2161
|
+
@interface GSKBarcodeScanFlow (SWIFT_EXTENSION(GSSDK))
|
|
2162
|
+
/// Instantiates a <code>GSKBarcodeScanFlow</code> instance with the provided configuration.
|
|
2163
|
+
/// This initializer is only available from Objective-C.
|
|
2164
|
+
+ (nonnull instancetype)barcodeScanFlowWithConfiguration:(GSKBarcodeScanFlowConfiguration * _Nonnull)configuration SWIFT_WARN_UNUSED_RESULT;
|
|
2165
|
+
/// Starts the barcode scanning flow.
|
|
2166
|
+
/// @param viewController The view controller to present the barcode scanning interface from.
|
|
2167
|
+
/// @param successBlock A completion block/closure that will be called on the main
|
|
2168
|
+
/// thread upon successful completion of the scan flow. It receives a <code>GSKBarcodeScanFlowResult</code> object as
|
|
2169
|
+
/// a parameter. This object gives you access to the scanned codes.
|
|
2170
|
+
/// @param failureBlock A block/closure called if an error was encountered.
|
|
2171
|
+
/// This method is only available from Objective-C.
|
|
2172
|
+
- (void)startFromViewController:(UIViewController * _Nonnull)viewController success:(void (^ _Nonnull)(GSKBarcodeScanFlowResult * _Nonnull))successBlock failure:(void (^ _Nonnull)(NSError * _Nonnull))failureBlock;
|
|
2173
|
+
@end
|
|
2174
|
+
|
|
2175
|
+
@class UIColor;
|
|
2176
|
+
/// Configuration for the UI barcode scanning flow
|
|
2177
|
+
/// This class allows customization of which barcode and QR code formats should be detected
|
|
2178
|
+
/// during the scanning process. By default, all supported formats are enabled.
|
|
2179
|
+
SWIFT_CLASS("_TtC5GSSDK31GSKBarcodeScanFlowConfiguration")
|
|
2180
|
+
@interface GSKBarcodeScanFlowConfiguration : NSObject
|
|
2181
|
+
/// Whether batch mode is enabled for code detection.
|
|
2182
|
+
/// This setting controls how codes are detected and when they are returned:
|
|
2183
|
+
/// <ul>
|
|
2184
|
+
/// <li>
|
|
2185
|
+
/// <code>false</code>: Detect multiple codes simultaneously in a single frame and return immediately (default)
|
|
2186
|
+
/// </li>
|
|
2187
|
+
/// <li>
|
|
2188
|
+
/// <code>true</code>: Collect multiple codes over time before returning when user taps Done
|
|
2189
|
+
/// </li>
|
|
2190
|
+
/// </ul>
|
|
2191
|
+
/// Example:
|
|
2192
|
+
/// \code
|
|
2193
|
+
/// // Standard mode - return codes immediately (default)
|
|
2194
|
+
/// let standardConfig = GSKBarcodeScanFlowConfiguration(isBatchModeEnabled: false)
|
|
2195
|
+
///
|
|
2196
|
+
/// // Batch mode - collect codes over time
|
|
2197
|
+
/// let batchConfig = GSKBarcodeScanFlowConfiguration(isBatchModeEnabled: true)
|
|
1951
2198
|
///
|
|
1952
|
-
///
|
|
1953
|
-
|
|
1954
|
-
|
|
2199
|
+
/// \endcode
|
|
2200
|
+
@property (nonatomic) BOOL isBatchModeEnabled;
|
|
2201
|
+
/// The highlight color used for the UI (overlay). Defaults
|
|
2202
|
+
/// to <code>.green</code>. For good contrast, we recommend using a bright color.
|
|
2203
|
+
@property (nonatomic, strong) UIColor * _Nonnull highlightColor;
|
|
2204
|
+
/// The menu color used for the UI. Defaults to <code>nil</code>, meaning that the system
|
|
2205
|
+
/// default color will be used (blue on iOS, for example).
|
|
2206
|
+
@property (nonatomic, strong) UIColor * _Nullable menuColor;
|
|
2207
|
+
/// Creates a new barcode scan flow configuration with default values
|
|
1955
2208
|
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
|
1956
2209
|
@end
|
|
1957
2210
|
|
|
1958
|
-
@class
|
|
1959
|
-
@
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
///
|
|
1966
|
-
///
|
|
1967
|
-
|
|
1968
|
-
+ (NSTimeInterval)minDurationInAboutToTriggerForTrigger SWIFT_WARN_UNUSED_RESULT;
|
|
1969
|
-
/// Public for legacy reasons, not to be used directly.
|
|
1970
|
-
@property (nonatomic, strong) AVCaptureDevice * _Nullable captureDevice;
|
|
1971
|
-
/// Public for legacy reasons, not to be used directly.
|
|
1972
|
-
@property (nonatomic, strong) AVCaptureSession * _Nullable captureSession;
|
|
1973
|
-
/// The flash mode. Default is .auto.
|
|
1974
|
-
@property (nonatomic) enum GSKCameraSessionFlashStatus flashStatus;
|
|
1975
|
-
/// Returns the current status of the document detection.
|
|
1976
|
-
/// This is a computed property that maps to the new activeDetectionMode property for backward compatibility.
|
|
1977
|
-
/// Observable.
|
|
1978
|
-
/// important:
|
|
1979
|
-
/// This property is deprecated. Use <code>activeDetectionMode</code> instead, which supports both document and readable
|
|
1980
|
-
/// code detection modes.
|
|
1981
|
-
@property (nonatomic) enum GSKCameraSessionDocumentDetection activeDocumentDetection SWIFT_DEPRECATED_MSG("Use activeDetectionMode instead");
|
|
1982
|
-
/// True for the duration of taking the photo and processing it. Observable.
|
|
1983
|
-
@property (nonatomic, readonly) BOOL isTakingPhoto;
|
|
1984
|
-
/// Returns false if flash isn’t supported on this device configuration.
|
|
1985
|
-
@property (nonatomic, readonly) BOOL supportsFlash;
|
|
1986
|
-
/// Public to be accessible from Objective-C, but should be private otherwise.
|
|
1987
|
-
@property (nonatomic, readonly, strong) dispatch_queue_t _Nullable captureSessionQueue;
|
|
1988
|
-
@property (nonatomic, readonly, strong) dispatch_queue_t _Nonnull takePhotoQueue;
|
|
1989
|
-
- (nonnull instancetype)initWithConfiguration:(GSKCameraSessionConfiguration * _Nonnull)configuration;
|
|
1990
|
-
- (void)pauseSession;
|
|
1991
|
-
- (void)resumeSession;
|
|
1992
|
-
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
|
|
1993
|
-
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
|
|
1994
|
-
@end
|
|
1995
|
-
|
|
1996
|
-
@class AVCaptureMetadataOutput;
|
|
1997
|
-
@class AVMetadataObject;
|
|
1998
|
-
@class AVCaptureConnection;
|
|
1999
|
-
@interface GSKCameraSession (SWIFT_EXTENSION(GSSDK)) <AVCaptureMetadataOutputObjectsDelegate>
|
|
2000
|
-
- (void)captureOutput:(AVCaptureMetadataOutput * _Nonnull)output didOutputMetadataObjects:(NSArray<AVMetadataObject *> * _Nonnull)metadataObjects fromConnection:(AVCaptureConnection * _Nonnull)connection;
|
|
2001
|
-
@end
|
|
2002
|
-
|
|
2003
|
-
@interface GSKCameraSession (SWIFT_EXTENSION(GSSDK))
|
|
2004
|
-
/// Manually take a photo
|
|
2005
|
-
/// If autoTriggerEnabled is true, the photo is taken automatically when the frame is detected.
|
|
2006
|
-
/// Otherwise, if you want to let the user manually trigger the photo, you can use this method.
|
|
2007
|
-
/// This method can be called even when activeDetectionMode is higlightAndTrigger and will force taking the
|
|
2008
|
-
/// photo.
|
|
2009
|
-
/// This method is thread-safe.
|
|
2010
|
-
/// IMPORTANT: Taking the photo will pause the session. You have to resume the session will <code>resumeSession</code> once
|
|
2011
|
-
/// you are done processing the result.
|
|
2012
|
-
- (void)takePhoto;
|
|
2013
|
-
@end
|
|
2014
|
-
|
|
2015
|
-
@class AVCapturePhotoOutput;
|
|
2016
|
-
@class AVCaptureResolvedPhotoSettings;
|
|
2017
|
-
@interface GSKCameraSession (SWIFT_EXTENSION(GSSDK)) <AVCapturePhotoCaptureDelegate>
|
|
2018
|
-
- (void)captureOutput:(AVCapturePhotoOutput * _Nonnull)output willBeginCaptureForResolvedSettings:(AVCaptureResolvedPhotoSettings * _Nonnull)resolvedSettings;
|
|
2019
|
-
- (void)captureOutput:(AVCapturePhotoOutput * _Nonnull)output willCapturePhotoForResolvedSettings:(AVCaptureResolvedPhotoSettings * _Nonnull)resolvedSettings;
|
|
2020
|
-
- (void)captureOutput:(AVCapturePhotoOutput * _Nonnull)output didCapturePhotoForResolvedSettings:(AVCaptureResolvedPhotoSettings * _Nonnull)resolvedSettings;
|
|
2021
|
-
- (void)captureOutput:(AVCapturePhotoOutput * _Nonnull)output didFinishProcessingPhoto:(AVCapturePhoto * _Nonnull)photo error:(NSError * _Nullable)error;
|
|
2022
|
-
- (void)captureOutput:(AVCapturePhotoOutput * _Nonnull)output didFinishCaptureForResolvedSettings:(AVCaptureResolvedPhotoSettings * _Nonnull)resolvedSettings error:(NSError * _Nullable)error;
|
|
2211
|
+
@class NSDictionary;
|
|
2212
|
+
@interface GSKBarcodeScanFlowConfiguration (SWIFT_EXTENSION(GSSDK))
|
|
2213
|
+
/// Create a configuration from a dictionary.
|
|
2214
|
+
/// This is used for interfacing with cross-platform plugins but shouldn’t
|
|
2215
|
+
/// be used in native projects.
|
|
2216
|
+
+ (GSKBarcodeScanFlowConfiguration * _Nullable)configurationWithDictionary:(NSDictionary * _Nonnull)dictionary error:(NSError * _Nullable * _Nullable)error SWIFT_WARN_UNUSED_RESULT;
|
|
2217
|
+
/// Create a configuration from JSON data.
|
|
2218
|
+
/// This is used for interfacing with cross-platform plugins but shouldn’t
|
|
2219
|
+
/// be used in native projects.
|
|
2220
|
+
+ (GSKBarcodeScanFlowConfiguration * _Nullable)configurationWithJSON:(NSString * _Nonnull)json error:(NSError * _Nullable * _Nullable)error SWIFT_WARN_UNUSED_RESULT;
|
|
2023
2221
|
@end
|
|
2024
2222
|
|
|
2025
|
-
/// The
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
///
|
|
2223
|
+
/// The result of a barcode scanning flow.
|
|
2224
|
+
/// This class encapsulates the successful outcome of a barcode or QR code scanning session,
|
|
2225
|
+
/// containing the detected barcode or QR code data.
|
|
2226
|
+
SWIFT_CLASS("_TtC5GSSDK24GSKBarcodeScanFlowResult")
|
|
2227
|
+
@interface GSKBarcodeScanFlowResult : NSObject
|
|
2228
|
+
/// The detected barcodes containing their decoded values and types.
|
|
2229
|
+
/// This property provides access to an array of detected codes, each containing
|
|
2230
|
+
/// both the string content and format type (e.g., QR code, Code 128, EAN-13, etc.).
|
|
2231
|
+
/// <ul>
|
|
2232
|
+
/// <li>
|
|
2233
|
+
/// For standard mode: Contains all codes detected in a single frame
|
|
2234
|
+
/// </li>
|
|
2235
|
+
/// <li>
|
|
2236
|
+
/// For batch mode: Contains all codes collected over the scanning session
|
|
2237
|
+
/// </li>
|
|
2238
|
+
/// </ul>
|
|
2239
|
+
@property (nonatomic, readonly, copy) NSArray<GSKBarcode *> * _Nonnull barcodes;
|
|
2240
|
+
/// Creates a new barcode scan flow result.
|
|
2241
|
+
/// \param barcodes The detected barcodes.
|
|
2031
2242
|
///
|
|
2032
|
-
- (nonnull instancetype)
|
|
2033
|
-
|
|
2034
|
-
|
|
2243
|
+
- (nonnull instancetype)initWithBarcodes:(NSArray<GSKBarcode *> * _Nonnull)barcodes OBJC_DESIGNATED_INITIALIZER;
|
|
2244
|
+
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
|
|
2245
|
+
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
|
|
2035
2246
|
@end
|
|
2036
2247
|
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
/// The
|
|
2040
|
-
|
|
2041
|
-
///
|
|
2042
|
-
///
|
|
2043
|
-
|
|
2044
|
-
///
|
|
2045
|
-
///
|
|
2046
|
-
|
|
2047
|
-
|
|
2248
|
+
@interface GSKBarcodeScanFlowResult (SWIFT_EXTENSION(GSSDK))
|
|
2249
|
+
/// Returns a dictionary representation of the result
|
|
2250
|
+
/// The dictionary contains:
|
|
2251
|
+
/// <ul>
|
|
2252
|
+
/// <li>
|
|
2253
|
+
/// barcodes: An array of code dictionaries, each containing:
|
|
2254
|
+
/// <ul>
|
|
2255
|
+
/// <li>
|
|
2256
|
+
/// value: The decoded string value
|
|
2257
|
+
/// </li>
|
|
2258
|
+
/// <li>
|
|
2259
|
+
/// type: The code type as a string (e.g., “qr”, “code128”)
|
|
2260
|
+
/// </li>
|
|
2261
|
+
/// </ul>
|
|
2262
|
+
/// </li>
|
|
2263
|
+
/// </ul>
|
|
2264
|
+
@property (nonatomic, readonly, copy) NSDictionary<NSString *, id> * _Nonnull dictionary;
|
|
2265
|
+
/// Returns a JSON representation of the result.
|
|
2266
|
+
/// See <code>dictionary</code> for an explanation of the JSON data’s structure.
|
|
2267
|
+
- (NSString * _Nonnull)json SWIFT_WARN_UNUSED_RESULT;
|
|
2268
|
+
@end
|
|
2048
2269
|
|
|
2049
2270
|
/// Represents an error raised by the camera session
|
|
2050
2271
|
typedef SWIFT_ENUM(NSInteger, GSKCameraSessionError, open) {
|
|
@@ -2059,83 +2280,210 @@ typedef SWIFT_ENUM(NSInteger, GSKCameraSessionError, open) {
|
|
|
2059
2280
|
GSKCameraSessionErrorWarnLockDevice = -1003,
|
|
2060
2281
|
};
|
|
2061
2282
|
|
|
2062
|
-
typedef SWIFT_ENUM(NSInteger, GSKCameraSessionFlashStatus, open) {
|
|
2063
|
-
GSKCameraSessionFlashStatusAuto = 0,
|
|
2064
|
-
GSKCameraSessionFlashStatusOn = 1,
|
|
2065
|
-
GSKCameraSessionFlashStatusOff = 2,
|
|
2066
|
-
};
|
|
2067
|
-
|
|
2068
2283
|
@class NSCoder;
|
|
2069
|
-
@protocol UIViewControllerTransitionCoordinator;
|
|
2070
2284
|
@class NSBundle;
|
|
2071
|
-
/// A
|
|
2285
|
+
/// A camera view controller to scan documents or barcodes.
|
|
2286
|
+
/// Inherit from this view controller to create a custom scanning experience. Lay out the <code>cameraView</code> as desired:
|
|
2287
|
+
/// By default, <code>cameraView</code> fills the entire screen. You can disable its resizing mask
|
|
2288
|
+
/// (<code>cameraView.translatesAutoresizingMaskIntoConstraints</code>) and use Auto Layout constraints.
|
|
2289
|
+
/// note:
|
|
2290
|
+
///
|
|
2291
|
+
/// When a photo of a document is taken, whether manually or automatically, the capture session is paused
|
|
2292
|
+
/// and a delegate callback (<code>cameraViewController(_:didGenerateScan:)</code>) is called when the photo is ready.
|
|
2293
|
+
/// In this callback, you can decide whether to exit the camera view controller (if you just need to scan a
|
|
2294
|
+
/// single page), or keep scanning more images (to support a “batch scanning” flow). For the latter scenario,
|
|
2295
|
+
/// you will need to resume the camera session (see <code>resume()</code>). You also need to “reveal” the shutter screen
|
|
2296
|
+
/// (see <code>hideShutterView(animated:)</code>).
|
|
2072
2297
|
SWIFT_CLASS("_TtC5GSSDK23GSKCameraViewController")
|
|
2073
2298
|
@interface GSKCameraViewController : UIViewController
|
|
2299
|
+
/// Requests camera access if needed.
|
|
2300
|
+
/// This returns immediately when access is already determined. It only shows the system prompt
|
|
2301
|
+
/// when access has not been requested yet.
|
|
2302
|
+
///
|
|
2303
|
+
/// returns:
|
|
2304
|
+
/// <code>true</code> when access is authorized.
|
|
2305
|
+
+ (void)requestCameraAccessWithCompletionHandler:(void (^ _Nonnull)(BOOL))completionHandler;
|
|
2074
2306
|
- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER SWIFT_UNAVAILABLE;
|
|
2075
|
-
- (nonnull instancetype)initWithCameraSession:(GSKCameraSession * _Nonnull)cameraSession OBJC_DESIGNATED_INITIALIZER;
|
|
2076
|
-
@property (nonatomic, readonly) BOOL prefersStatusBarHidden;
|
|
2077
|
-
- (void)loadView;
|
|
2078
2307
|
- (void)viewDidLoad;
|
|
2079
2308
|
- (void)viewWillAppear:(BOOL)animated;
|
|
2080
2309
|
- (void)viewWillDisappear:(BOOL)animated;
|
|
2081
|
-
|
|
2310
|
+
/// Manually trigger a photo.
|
|
2311
|
+
/// Use this to handle the user tapping on a “take photo” button, or your own
|
|
2312
|
+
/// custom logic to take a photo.
|
|
2313
|
+
- (void)takePhoto;
|
|
2082
2314
|
- (nonnull instancetype)initWithNibName:(NSString * _Nullable)nibNameOrNil bundle:(NSBundle * _Nullable)nibBundleOrNil SWIFT_UNAVAILABLE;
|
|
2083
2315
|
@end
|
|
2084
2316
|
|
|
2085
|
-
@
|
|
2086
|
-
@interface GSKCameraViewController (SWIFT_EXTENSION(GSSDK)) <GSKViewDelegate>
|
|
2087
|
-
- (void)cameraView:(GSKView * _Nonnull)cameraView requestedFocusAtPoint:(CGPoint)focusPoint;
|
|
2317
|
+
@interface GSKCameraViewController (SWIFT_EXTENSION(GSSDK))
|
|
2088
2318
|
@end
|
|
2089
2319
|
|
|
2320
|
+
/// A document detection mode
|
|
2321
|
+
/// When detecting a document, the camera controller can just highlight the document, or also
|
|
2322
|
+
/// highlight and trigger the photo when the detection is stable enough.
|
|
2323
|
+
typedef SWIFT_ENUM(NSInteger, DocumentDetectionMode, open) {
|
|
2324
|
+
/// Visual highlighting only.
|
|
2325
|
+
/// The camera will detect document edges and provide visual feedback by drawing
|
|
2326
|
+
/// a document overlay, but will not automatically capture photos. Users must
|
|
2327
|
+
/// manually trigger photo capture.
|
|
2328
|
+
DocumentDetectionModeHighlightOnly = 0,
|
|
2329
|
+
/// Highlighting with automatic capture.
|
|
2330
|
+
/// Similar to <code>highlightOnly</code>, but the camera will automatically take a photo
|
|
2331
|
+
/// when a stable document is detected for a sufficient duration. This provides
|
|
2332
|
+
/// a hands-free scanning experience.
|
|
2333
|
+
DocumentDetectionModeHighlightAndAutoCapture = 1,
|
|
2334
|
+
};
|
|
2335
|
+
|
|
2090
2336
|
@interface GSKCameraViewController (SWIFT_EXTENSION(GSSDK))
|
|
2091
|
-
/// Snap the photo
|
|
2092
|
-
- (void)takePhoto;
|
|
2093
2337
|
@end
|
|
2094
2338
|
|
|
2095
|
-
|
|
2096
|
-
|
|
2339
|
+
/// Constants indicating an interruption reason for the camera session.
|
|
2340
|
+
typedef SWIFT_ENUM(NSInteger, InterruptionReason, open) {
|
|
2341
|
+
/// An interruption caused by the app being sent to the background while using a camera.
|
|
2342
|
+
InterruptionReasonVideoDeviceNotAvailableInBackground = 0,
|
|
2343
|
+
/// An interruption caused by the audio hardware temporarily being made unavailable, for instance,
|
|
2344
|
+
/// for a phone call, or alarm.
|
|
2345
|
+
InterruptionReasonAudioDeviceInUseByAnotherClient = 1,
|
|
2346
|
+
/// An interruption caused by the video device temporarily being made unavailable, for instance,
|
|
2347
|
+
/// when stolen away by another app.
|
|
2348
|
+
InterruptionReasonVideoDeviceInUseByAnotherClient = 2,
|
|
2349
|
+
/// An interruption caused when the app is running in a multi-app layout, causing resource contention
|
|
2350
|
+
/// and degraded recording quality of service. Given your present session configuration, the
|
|
2351
|
+
/// session may only be run if your app occupies the full screen.
|
|
2352
|
+
InterruptionReasonVideoDeviceNotAvailableWithMultipleForegroundApps = 3,
|
|
2353
|
+
/// An interruption caused by the video device temporarily being made unavailable due to system pressure,
|
|
2354
|
+
/// such as thermal duress.
|
|
2355
|
+
InterruptionReasonVideoDeviceNotAvailableDueToSystemPressure = 4,
|
|
2356
|
+
InterruptionReasonUnknown = 5,
|
|
2357
|
+
};
|
|
2358
|
+
|
|
2097
2359
|
@interface GSKCameraViewController (SWIFT_EXTENSION(GSSDK))
|
|
2098
|
-
|
|
2099
|
-
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2360
|
+
/// Factory method for a camera view controller with document detection.
|
|
2361
|
+
/// This is only to be used from Objective-C. From Swift, prefer using <code>init(configuration:)</code> instead.
|
|
2362
|
+
/// \param documentDetectionMode The document detection mode.
|
|
2363
|
+
///
|
|
2364
|
+
/// \param documentOverlayColor The color of the document overlay.
|
|
2365
|
+
///
|
|
2366
|
+
+ (void)makeCameraViewControllerWithDocumentDetectionMode:(enum DocumentDetectionMode)documentDetectionMode documentOverlayColor:(UIColor * _Nonnull)documentOverlayColor completionHandler:(void (^ _Nonnull)(GSKCameraViewController * _Nullable, NSError * _Nullable))completionHandler;
|
|
2367
|
+
@end
|
|
2368
|
+
|
|
2369
|
+
@class GSKQuadrangle;
|
|
2370
|
+
@class GSKScan;
|
|
2371
|
+
SWIFT_PROTOCOL("_TtP5GSSDK31GSKCameraViewControllerDelegate_")
|
|
2372
|
+
@protocol GSKCameraViewControllerDelegate
|
|
2373
|
+
@optional
|
|
2374
|
+
/// The camera view controller failed with an error.
|
|
2375
|
+
/// \param cameraViewController The camera view controller
|
|
2376
|
+
///
|
|
2377
|
+
/// \param error The encountered error.
|
|
2378
|
+
///
|
|
2379
|
+
- (void)cameraViewController:(GSKCameraViewController * _Nonnull)cameraViewController didFailWithError:(NSError * _Nonnull)error;
|
|
2380
|
+
/// The camera view controller encountered a non-fatal error.
|
|
2381
|
+
/// \param cameraViewController The camera view controller
|
|
2382
|
+
///
|
|
2383
|
+
/// \param error The encountered error.
|
|
2384
|
+
///
|
|
2385
|
+
- (void)cameraViewController:(GSKCameraViewController * _Nonnull)cameraViewController didEncounterNonCriticalError:(NSError * _Nonnull)error;
|
|
2386
|
+
/// The camera view controller started running
|
|
2387
|
+
/// \param cameraViewController The camera view controller
|
|
2388
|
+
///
|
|
2389
|
+
- (void)cameraViewControllerDidStart:(GSKCameraViewController * _Nonnull)cameraViewController;
|
|
2390
|
+
/// The camera view controller stopped running
|
|
2391
|
+
/// \param cameraViewController The camera view controller
|
|
2392
|
+
///
|
|
2393
|
+
- (void)cameraViewControllerDidStop:(GSKCameraViewController * _Nonnull)cameraViewController;
|
|
2394
|
+
/// The camera view controller was interrupted.
|
|
2395
|
+
/// This can happen in various cases, including when the user goes to Split View mode on iPad.
|
|
2396
|
+
/// \param cameraViewController The camera view controller
|
|
2397
|
+
///
|
|
2398
|
+
/// \param reason The reason why the camera view controller was interrupted.
|
|
2399
|
+
///
|
|
2400
|
+
- (void)cameraViewController:(GSKCameraViewController * _Nonnull)cameraViewController wasInterruptedWithReason:(enum InterruptionReason)reason;
|
|
2401
|
+
/// The camera view controller resumes after interruption
|
|
2402
|
+
/// \param cameraViewController The camera view controller
|
|
2403
|
+
///
|
|
2404
|
+
- (void)cameraViewControllerInterruptionDidEnd:(GSKCameraViewController * _Nonnull)cameraViewController;
|
|
2405
|
+
/// The camera view controller is still looking for a quadrangle.
|
|
2406
|
+
/// This is a general notification about the status of the search: we may or may not have identified
|
|
2407
|
+
/// its edges. If you want to act on identified edges, listen to the <code>cameraViewController:didFindDocumentWithQuadrangle:</code>
|
|
2408
|
+
/// delegate method.
|
|
2409
|
+
/// <ul>
|
|
2410
|
+
/// <li>
|
|
2411
|
+
/// Parameters:
|
|
2412
|
+
/// </li>
|
|
2413
|
+
/// <li>
|
|
2414
|
+
/// cameraViewController: The camera view controller
|
|
2415
|
+
/// </li>
|
|
2416
|
+
/// </ul>
|
|
2417
|
+
- (void)cameraViewControllerIsSearchingForDocument:(GSKCameraViewController * _Nonnull)cameraViewController;
|
|
2418
|
+
/// The camera view controller identified a document in the last frame of the photo stream
|
|
2419
|
+
/// \param cameraViewController The camera view controller
|
|
2420
|
+
///
|
|
2421
|
+
/// \param quadrangle The quadrangle of the document that has been found.
|
|
2422
|
+
///
|
|
2423
|
+
- (void)cameraViewController:(GSKCameraViewController * _Nonnull)cameraViewController didFindDocumentWithQuadrangle:(GSKQuadrangle * _Nonnull)quadrangle;
|
|
2424
|
+
/// The camera view controller couldn’t identify a document in the last frame of the photo stream.
|
|
2425
|
+
/// This doesn’t mean that the camera view controller has stopped searching for documents or failed.
|
|
2426
|
+
/// It just means no document has been identified. In this case, you want to clear any overlay.
|
|
2427
|
+
/// \param cameraViewController The camera view controller
|
|
2428
|
+
///
|
|
2429
|
+
- (void)cameraViewControllerFailedToFindDocument:(GSKCameraViewController * _Nonnull)cameraViewController;
|
|
2430
|
+
/// The camera view controller real-time document detection will soon take the photo of a quadrangle, but if the document
|
|
2431
|
+
/// detection is not stable enough, the process can still be
|
|
2432
|
+
/// cancelled.
|
|
2433
|
+
/// It’s a good time to tell the user to remain stable.
|
|
2434
|
+
/// Only called when the document detection is set to .highlightAndAutoCapture.
|
|
2435
|
+
/// \param cameraViewController The camera view controller
|
|
2436
|
+
///
|
|
2437
|
+
- (void)cameraViewControllerPhotoStabilizationDidStart:(GSKCameraViewController * _Nonnull)cameraViewController;
|
|
2438
|
+
/// The camera view controller is going to automatically take a photo because the detection was stable enough.
|
|
2439
|
+
/// The photo taking is underway and cannot be interrupted at this stage.
|
|
2440
|
+
/// \param cameraViewController The camera view controller
|
|
2441
|
+
///
|
|
2442
|
+
/// \param quadrangle The quadrangle of the document that will be photographed.
|
|
2443
|
+
///
|
|
2444
|
+
- (void)cameraViewController:(GSKCameraViewController * _Nonnull)cameraViewController willSnapPhotoWithQuadrangle:(GSKQuadrangle * _Nonnull)quadrangle;
|
|
2445
|
+
/// The camera view controller just took a photo, but it hasn’t been post-processed it yet
|
|
2446
|
+
/// \param cameraViewController The camera view controller
|
|
2447
|
+
///
|
|
2448
|
+
- (void)cameraViewControllerDidSnapPhoto:(GSKCameraViewController * _Nonnull)cameraViewController;
|
|
2449
|
+
/// The camera view controller has finished processing the photo we just took.
|
|
2450
|
+
/// \param cameraViewController The camera view controller
|
|
2451
|
+
///
|
|
2452
|
+
/// \param scan The scan object that has been generated. The image contained in the scan object is the full,
|
|
2453
|
+
/// unprocessed image in which the document was detected. Use <code>GSKScanProcessor</code> to process and
|
|
2454
|
+
/// warp and enhance the scanned document.
|
|
2455
|
+
///
|
|
2456
|
+
- (void)cameraViewController:(GSKCameraViewController * _Nonnull)cameraViewController didGenerateScan:(GSKScan * _Nonnull)scan;
|
|
2457
|
+
/// Camera view controller has detected barcodes.
|
|
2458
|
+
/// \param cameraViewController The camera view controller
|
|
2459
|
+
///
|
|
2460
|
+
/// \param barcodes The detected barcodes
|
|
2461
|
+
///
|
|
2462
|
+
- (void)cameraViewController:(GSKCameraViewController * _Nonnull)cameraViewController didFindBarcodes:(NSArray<GSKBarcode *> * _Nonnull)barcodes;
|
|
2115
2463
|
@end
|
|
2116
2464
|
|
|
2117
2465
|
/// The type of document detected by the document finder.
|
|
2118
2466
|
typedef SWIFT_ENUM(NSInteger, GSKDocumentFinderImageType, closed) {
|
|
2119
2467
|
/// No document present in the image
|
|
2120
2468
|
GSKDocumentFinderImageTypeNoDocument = 0,
|
|
2121
|
-
/// A document present in the image, but no crop
|
|
2469
|
+
/// A document is present in the image, but no crop or perspective correction has been applied.
|
|
2122
2470
|
GSKDocumentFinderImageTypeUnwarped = 1,
|
|
2123
|
-
/// A document present in the image, and crop
|
|
2471
|
+
/// A document is present in the image, and crop and perspective correction have been applied.
|
|
2124
2472
|
GSKDocumentFinderImageTypeWarped = 2,
|
|
2125
|
-
/// A document present in the image, crop/perspective correction and
|
|
2126
|
-
///
|
|
2473
|
+
/// A document is present in the image, and crop/perspective correction and
|
|
2474
|
+
/// enhancement have been applied.
|
|
2127
2475
|
GSKDocumentFinderImageTypeEnhanced = 3,
|
|
2128
2476
|
};
|
|
2129
2477
|
|
|
2130
2478
|
@class GSKPDFDocument;
|
|
2131
2479
|
@protocol GSKDocumentImageProcessor;
|
|
2132
2480
|
@class GSKDocumentGeneratorConfiguration;
|
|
2133
|
-
/// This class exposes the
|
|
2481
|
+
/// This class exposes the capability to generate a PDF or TIFF multi-page document file.
|
|
2134
2482
|
SWIFT_CLASS("_TtC5GSSDK20GSKDocumentGenerator")
|
|
2135
2483
|
@interface GSKDocumentGenerator : NSObject
|
|
2136
2484
|
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
|
2137
2485
|
/// Generates a document file based on a document model and a generator configuration.
|
|
2138
|
-
/// \param document The source document to generate as PDF.
|
|
2486
|
+
/// \param document The source document to generate as PDF or TIFF depending on the configuration.
|
|
2139
2487
|
///
|
|
2140
2488
|
/// \param imageProcessor An object used to process each source document’s image before inserting it in the resulting document.
|
|
2141
2489
|
/// Only used when generating a PDF document
|
|
@@ -2144,7 +2492,7 @@ SWIFT_CLASS("_TtC5GSSDK20GSKDocumentGenerator")
|
|
|
2144
2492
|
///
|
|
2145
2493
|
- (BOOL)generate:(GSKPDFDocument * _Nonnull)document imageProcessor:(id <GSKDocumentImageProcessor> _Nonnull)imageProcessor configuration:(GSKDocumentGeneratorConfiguration * _Nonnull)configuration error:(NSError * _Nullable * _Nullable)error;
|
|
2146
2494
|
/// Generates a document file based on a document model and a generator configuration.
|
|
2147
|
-
/// \param document The source document to generate as PDF.
|
|
2495
|
+
/// \param document The source document to generate as PDF or TIFF depending on the configuration.
|
|
2148
2496
|
///
|
|
2149
2497
|
/// \param configuration The configuration for the document generation.
|
|
2150
2498
|
///
|
|
@@ -2158,7 +2506,7 @@ SWIFT_CLASS("_TtC5GSSDK33GSKDocumentGeneratorConfiguration")
|
|
|
2158
2506
|
@interface GSKDocumentGeneratorConfiguration : NSObject
|
|
2159
2507
|
+ (GSKDocumentGeneratorConfiguration * _Nonnull)pdfConfigurationWithOutputFilePath:(NSString * _Nonnull)outputFilePath SWIFT_WARN_UNUSED_RESULT;
|
|
2160
2508
|
+ (GSKDocumentGeneratorConfiguration * _Nonnull)tiffConfigurationWithOutputFilePath:(NSString * _Nonnull)outputFilePath SWIFT_WARN_UNUSED_RESULT;
|
|
2161
|
-
/// The output file format of the document generator. Must be .pdf or .
|
|
2509
|
+
/// The output file format of the document generator. Must be .pdf or .tiff.
|
|
2162
2510
|
@property (nonatomic, readonly) enum GSKDocumentGeneratorFileFormat outputFileFormat;
|
|
2163
2511
|
/// The path where the generated document will be written. The extension will not be validated.
|
|
2164
2512
|
@property (nonatomic, readonly, copy) NSString * _Nonnull outputFilePath;
|
|
@@ -2189,7 +2537,7 @@ SWIFT_CLASS("_TtC5GSSDK33GSKDocumentGeneratorConfiguration")
|
|
|
2189
2537
|
|
|
2190
2538
|
SWIFT_CLASS("_TtC5GSSDK38GSKDocumentGeneratorDebugConfiguration")
|
|
2191
2539
|
@interface GSKDocumentGeneratorDebugConfiguration : NSObject
|
|
2192
|
-
/// If true, OCR’ed text will visible on the PDF.
|
|
2540
|
+
/// If true, OCR’ed text will be visible on the PDF.
|
|
2193
2541
|
/// Defaults to false. Use this for debug only
|
|
2194
2542
|
@property (nonatomic, readonly) BOOL isOCRTextShownOnPDF;
|
|
2195
2543
|
- (nonnull instancetype)initWithIsOCRTextShownOnPDF:(BOOL)isOCRTextShownOnPDF OBJC_DESIGNATED_INITIALIZER;
|
|
@@ -2233,6 +2581,52 @@ SWIFT_PROTOCOL("_TtP5GSSDK25GSKDocumentImageProcessor_")
|
|
|
2233
2581
|
- (NSString * _Nullable)process:(NSString * _Nonnull)inputFilePath SWIFT_WARN_UNUSED_RESULT;
|
|
2234
2582
|
@end
|
|
2235
2583
|
|
|
2584
|
+
@class UIImage;
|
|
2585
|
+
@class UIView;
|
|
2586
|
+
/// A view controller that displays a scanned image with an interactive quadrangle overlay
|
|
2587
|
+
/// for manual cropping and perspective adjustment.
|
|
2588
|
+
/// <code>GSKEditFrameViewController</code> presents an image and allows the user to refine the detected
|
|
2589
|
+
/// document boundaries by dragging the quadrangle’s corner handles. As the user edits the
|
|
2590
|
+
/// quadrangle, changes are reflected in the <code>quadrangle</code> property, which is Key-Value
|
|
2591
|
+
/// Observing (KVO) compliant.
|
|
2592
|
+
/// The overlay’s appearance—including colors, handle size, transparency, and magnifier
|
|
2593
|
+
/// behavior—can be customized through the exposed properties. This view controller is
|
|
2594
|
+
/// typically used after automatic document detection, to let the user fine-tune the crop
|
|
2595
|
+
/// before further processing (such as perspective correction or export).
|
|
2596
|
+
SWIFT_CLASS("_TtC5GSSDK26GSKEditFrameViewController")
|
|
2597
|
+
@interface GSKEditFrameViewController : UIViewController
|
|
2598
|
+
/// The image on which the quadrangle is overlaid.
|
|
2599
|
+
@property (nonatomic, strong) UIImage * _Nonnull image;
|
|
2600
|
+
@property (nonatomic, readonly, strong) UIView * _Nonnull frameView;
|
|
2601
|
+
/// Used to set the quadrangle to display in the view controller, and to retrieve the new quadrangle edited by the user.
|
|
2602
|
+
@property (nonatomic, strong) GSKQuadrangle * _Nonnull quadrangle;
|
|
2603
|
+
/// Insets applied around the image.
|
|
2604
|
+
/// By default this matches half the quadrangle overlay handle width, so handles remain visible even when
|
|
2605
|
+
/// the corners are on the edge of the image.
|
|
2606
|
+
@property (nonatomic) CGFloat inset;
|
|
2607
|
+
/// Customize the color of the shade within the quadrangle.
|
|
2608
|
+
@property (nonatomic, strong) UIColor * _Nonnull shadeColor SWIFT_DEPRECATED_MSG("Deprecated in favor of frameView.imageSelection.insideShadeColor.");
|
|
2609
|
+
/// Customize the color of the shade outside the quadrangle.
|
|
2610
|
+
@property (nonatomic, strong) UIColor * _Nonnull outsideShadeColor;
|
|
2611
|
+
/// Customize the color of the line used to draw the quadrangle.
|
|
2612
|
+
@property (nonatomic, strong) UIColor * _Nonnull lineColor;
|
|
2613
|
+
/// Customize the width of the corner handles.
|
|
2614
|
+
@property (nonatomic) CGFloat handleWidth;
|
|
2615
|
+
/// Customize the transparency of the entire overlay
|
|
2616
|
+
@property (nonatomic) CGFloat overlayAlpha;
|
|
2617
|
+
/// Customize the magnifier center style shown while dragging corners.
|
|
2618
|
+
@property (nonatomic) GSKMagnifierViewCenterStyle magnifierViewCenterStyle;
|
|
2619
|
+
/// \param image The image on which to draw the quadrangle. This is typically the original photo from the camera.
|
|
2620
|
+
///
|
|
2621
|
+
/// \param quadrangle The initial quadrangle to display.
|
|
2622
|
+
///
|
|
2623
|
+
- (nonnull instancetype)initWithImage:(UIImage * _Nonnull)image quadrangle:(GSKQuadrangle * _Nonnull)quadrangle OBJC_DESIGNATED_INITIALIZER;
|
|
2624
|
+
- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER SWIFT_UNAVAILABLE;
|
|
2625
|
+
- (void)setQuadrangle:(GSKQuadrangle * _Nonnull)quadrangle animated:(BOOL)animated;
|
|
2626
|
+
- (void)viewDidLoad;
|
|
2627
|
+
- (nonnull instancetype)initWithNibName:(NSString * _Nullable)nibNameOrNil bundle:(NSBundle * _Nullable)nibBundleOrNil SWIFT_UNAVAILABLE;
|
|
2628
|
+
@end
|
|
2629
|
+
|
|
2236
2630
|
/// A configuration to specify the background cleaning to apply with GSKScanProcessor.
|
|
2237
2631
|
SWIFT_CLASS("_TtC5GSSDK40GSKFilterBackgroundCleaningConfiguration")
|
|
2238
2632
|
@interface GSKFilterBackgroundCleaningConfiguration : NSObject
|
|
@@ -2398,6 +2792,12 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) GSKFilterLig
|
|
|
2398
2792
|
- (BOOL)isEqual:(id _Nullable)object SWIFT_WARN_UNUSED_RESULT;
|
|
2399
2793
|
@end
|
|
2400
2794
|
|
|
2795
|
+
typedef SWIFT_ENUM(NSInteger, GSKFlashStatus, open) {
|
|
2796
|
+
GSKFlashStatusAuto = 0,
|
|
2797
|
+
GSKFlashStatusOn = 1,
|
|
2798
|
+
GSKFlashStatusOff = 2,
|
|
2799
|
+
};
|
|
2800
|
+
|
|
2401
2801
|
enum GSKIntegrationFramework : NSInteger;
|
|
2402
2802
|
SWIFT_CLASS_NAMED("GSKIntegrationContext")
|
|
2403
2803
|
@interface GSKIntegrationContext : NSObject
|
|
@@ -2437,14 +2837,14 @@ SWIFT_CLASS("_TtC5GSSDK6GSKOCR")
|
|
|
2437
2837
|
/// The OCR decides what post-processing to apply for the best results.
|
|
2438
2838
|
///
|
|
2439
2839
|
/// \param configuration Configuration for the OCR process, in particular the language in which the OCR is
|
|
2440
|
-
/// performed. Note that you must
|
|
2840
|
+
/// performed. Note that you must provide the appropriate trained data.
|
|
2441
2841
|
///
|
|
2442
2842
|
/// \param progressBlock The progress between 0 and 1. Called on the same thread.
|
|
2443
2843
|
///
|
|
2444
2844
|
///
|
|
2445
2845
|
/// returns:
|
|
2446
2846
|
/// An OCR result.
|
|
2447
|
-
- (void)recognizeTextForImageAtPath:(NSString * _Nonnull)imagePath
|
|
2847
|
+
- (void)recognizeTextForImageAtPath:(NSString * _Nonnull)imagePath configuration:(GSKOCRConfiguration * _Nonnull)configuration onProgress:(void (^ _Nullable)(float))progressBlock completionHandler:(void (^ _Nonnull)(GSKOCRResult * _Nullable, NSError * _Nullable))completionHandler;
|
|
2448
2848
|
@end
|
|
2449
2849
|
|
|
2450
2850
|
/// The configuration for an OCR operation.
|
|
@@ -2532,186 +2932,6 @@ SWIFT_CLASS("_TtC5GSSDK10GSKPDFSize")
|
|
|
2532
2932
|
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
|
|
2533
2933
|
@end
|
|
2534
2934
|
|
|
2535
|
-
@class GSKReadableCodeFlowConfiguration;
|
|
2536
|
-
@class GSKReadableCodeFlowResult;
|
|
2537
|
-
/// A flow for scanning readable codes (barcodes, QR codes, etc.)
|
|
2538
|
-
SWIFT_CLASS("_TtC5GSSDK19GSKReadableCodeFlow")
|
|
2539
|
-
@interface GSKReadableCodeFlow : NSObject
|
|
2540
|
-
/// Initializes a new readable code flow
|
|
2541
|
-
/// \param configuration Configuration for the readable code scanning
|
|
2542
|
-
///
|
|
2543
|
-
- (nonnull instancetype)initWithConfiguration:(GSKReadableCodeFlowConfiguration * _Nonnull)configuration OBJC_DESIGNATED_INITIALIZER;
|
|
2544
|
-
/// Starts the readable code scanning flow by presenting a full-screen camera interface.
|
|
2545
|
-
/// This method presents a camera view controller that continuously scans for barcodes and QR codes.
|
|
2546
|
-
/// The scanning process respects the code types specified in the flow’s configuration.
|
|
2547
|
-
/// The method uses Swift’s async/await pattern, suspending until either:
|
|
2548
|
-
/// <ul>
|
|
2549
|
-
/// <li>
|
|
2550
|
-
/// A readable code is successfully detected (except in batch mode)
|
|
2551
|
-
/// </li>
|
|
2552
|
-
/// <li>
|
|
2553
|
-
/// The user taps the done button (batch mode)
|
|
2554
|
-
/// </li>
|
|
2555
|
-
/// <li>
|
|
2556
|
-
/// The user cancels the operation
|
|
2557
|
-
/// </li>
|
|
2558
|
-
/// <li>
|
|
2559
|
-
/// An error occurs during setup or scanning
|
|
2560
|
-
/// </li>
|
|
2561
|
-
/// </ul>
|
|
2562
|
-
/// The behavior varies based on the configuration’s isBatchModeEnabled:
|
|
2563
|
-
/// <ul>
|
|
2564
|
-
/// <li>
|
|
2565
|
-
/// <code>false</code>: Returns immediately after detecting one or more codes in a single frame
|
|
2566
|
-
/// </li>
|
|
2567
|
-
/// <li>
|
|
2568
|
-
/// <code>true</code>: Collects unique codes over time until the user taps the done button
|
|
2569
|
-
/// </li>
|
|
2570
|
-
/// </ul>
|
|
2571
|
-
/// Example usage:
|
|
2572
|
-
/// \code
|
|
2573
|
-
/// let flow = GSKReadableCodeFlow()
|
|
2574
|
-
/// do {
|
|
2575
|
-
/// let result = try await flow.resultByStarting(fromViewController: self)
|
|
2576
|
-
/// print("Scanned codes: \(result.readableCodes.map { $0.value })")
|
|
2577
|
-
/// } catch GSKReadableCodeFlowError.userCancellation {
|
|
2578
|
-
/// print("User canceled scanning")
|
|
2579
|
-
/// } catch {
|
|
2580
|
-
/// print("Scanning failed: \(error)")
|
|
2581
|
-
/// }
|
|
2582
|
-
///
|
|
2583
|
-
/// \endcodeimportant:
|
|
2584
|
-
/// This method requires camera permissions. Ensure your app’s Info.plist includes
|
|
2585
|
-
/// the <code>NSCameraUsageDescription</code> key with an appropriate description.
|
|
2586
|
-
/// note:
|
|
2587
|
-
/// The camera interface is presented with <code>modalPresentationStyle</code> set to <code>.fullScreen</code>
|
|
2588
|
-
/// for an immersive scanning experience.
|
|
2589
|
-
/// \param viewController The view controller from which to present the camera interface.
|
|
2590
|
-
/// This should typically be the currently visible view controller.
|
|
2591
|
-
///
|
|
2592
|
-
///
|
|
2593
|
-
/// throws:
|
|
2594
|
-
///
|
|
2595
|
-
/// <ul>
|
|
2596
|
-
/// <li>
|
|
2597
|
-
/// Typically throws a <code>GSKReadableCodeFlowError</code>
|
|
2598
|
-
/// </li>
|
|
2599
|
-
/// </ul>
|
|
2600
|
-
///
|
|
2601
|
-
/// returns:
|
|
2602
|
-
/// A <code>GSKReadableCodeFlowResult</code> containing the detected readable codes with their
|
|
2603
|
-
/// decoded values and format types.
|
|
2604
|
-
- (void)resultByStartingFromViewController:(UIViewController * _Nonnull)viewController completionHandler:(void (^ _Nonnull)(GSKReadableCodeFlowResult * _Nullable, NSError * _Nullable))completionHandler;
|
|
2605
|
-
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
|
|
2606
|
-
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
|
|
2607
|
-
@end
|
|
2608
|
-
|
|
2609
|
-
@class NSError;
|
|
2610
|
-
@interface GSKReadableCodeFlow (SWIFT_EXTENSION(GSSDK))
|
|
2611
|
-
/// Instantiates a <code>GSKReadableCodeFlow</code> instance with the provided configuration.
|
|
2612
|
-
/// This initializer is only available from Objective-C.
|
|
2613
|
-
+ (nonnull instancetype)readableCodeFlowWithConfiguration:(GSKReadableCodeFlowConfiguration * _Nonnull)configuration SWIFT_WARN_UNUSED_RESULT;
|
|
2614
|
-
/// Starts the readable code scanning flow.
|
|
2615
|
-
/// @param viewController The view controller to present the readable code scanning interface from.
|
|
2616
|
-
/// @param successBlock A completion block/closure that will be called on the main
|
|
2617
|
-
/// thread upon successful completion of the scan flow. It receives a <code>GSKReadableCodeFlowResult</code> object as
|
|
2618
|
-
/// a parameter. This object gives you access to the scanned codes.
|
|
2619
|
-
/// @param failureBlock A block/closure called if an error was encountered.
|
|
2620
|
-
/// This method is only available from Objective-C.
|
|
2621
|
-
- (void)startFromViewController:(UIViewController * _Nonnull)viewController success:(void (^ _Nonnull)(GSKReadableCodeFlowResult * _Nonnull))successBlock failure:(void (^ _Nonnull)(NSError * _Nonnull))failureBlock;
|
|
2622
|
-
@end
|
|
2623
|
-
|
|
2624
|
-
@class UIColor;
|
|
2625
|
-
/// Configuration for the UI readable code scanning flow
|
|
2626
|
-
/// This class allows customization of which barcode and QR code formats should be detected
|
|
2627
|
-
/// during the scanning process. By default, all supported formats are enabled.
|
|
2628
|
-
SWIFT_CLASS("_TtC5GSSDK32GSKReadableCodeFlowConfiguration")
|
|
2629
|
-
@interface GSKReadableCodeFlowConfiguration : NSObject
|
|
2630
|
-
/// Whether batch mode is enabled for code detection.
|
|
2631
|
-
/// This setting controls how codes are detected and when they are returned:
|
|
2632
|
-
/// <ul>
|
|
2633
|
-
/// <li>
|
|
2634
|
-
/// <code>false</code>: Detect multiple codes simultaneously in a single frame and return immediately (default)
|
|
2635
|
-
/// </li>
|
|
2636
|
-
/// <li>
|
|
2637
|
-
/// <code>true</code>: Collect multiple codes over time before returning when user taps Done
|
|
2638
|
-
/// </li>
|
|
2639
|
-
/// </ul>
|
|
2640
|
-
/// Example:
|
|
2641
|
-
/// \code
|
|
2642
|
-
/// // Standard mode - return codes immediately (default)
|
|
2643
|
-
/// let standardConfig = GSKReadableCodeFlowConfiguration(isBatchModeEnabled: false)
|
|
2644
|
-
///
|
|
2645
|
-
/// // Batch mode - collect codes over time
|
|
2646
|
-
/// let batchConfig = GSKReadableCodeFlowConfiguration(isBatchModeEnabled: true)
|
|
2647
|
-
///
|
|
2648
|
-
/// \endcode
|
|
2649
|
-
@property (nonatomic) BOOL isBatchModeEnabled;
|
|
2650
|
-
/// The highlight color used for the UI (overlay). Defaults
|
|
2651
|
-
/// to <code>.green</code>. For good constrast, we recommend using a bright color.
|
|
2652
|
-
@property (nonatomic, strong) UIColor * _Nonnull highlightColor;
|
|
2653
|
-
/// The menu color used for the UI. Defaults to <code>nil</code>, meaning that the system
|
|
2654
|
-
/// default color will be used (blue on iOS, for example).
|
|
2655
|
-
@property (nonatomic, strong) UIColor * _Nullable menuColor;
|
|
2656
|
-
/// Creates a new readable code flow configuration with default values
|
|
2657
|
-
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
|
2658
|
-
@end
|
|
2659
|
-
|
|
2660
|
-
@interface GSKReadableCodeFlowConfiguration (SWIFT_EXTENSION(GSSDK))
|
|
2661
|
-
/// Create a configuration from a dictionary.
|
|
2662
|
-
/// This is used for interfacing with cross-platform plugins but shouldn’t
|
|
2663
|
-
/// be used in native projects.
|
|
2664
|
-
+ (GSKReadableCodeFlowConfiguration * _Nullable)configurationWithDictionary:(NSDictionary * _Nonnull)dictionary error:(NSError * _Nullable * _Nullable)error SWIFT_WARN_UNUSED_RESULT;
|
|
2665
|
-
/// Create a configuration from JSON data.
|
|
2666
|
-
/// This is used for interfacing with cross-platform plugins but shouldn’t
|
|
2667
|
-
/// be used in native projects.
|
|
2668
|
-
+ (GSKReadableCodeFlowConfiguration * _Nullable)configurationWithJSON:(NSString * _Nonnull)json error:(NSError * _Nullable * _Nullable)error SWIFT_WARN_UNUSED_RESULT;
|
|
2669
|
-
@end
|
|
2670
|
-
|
|
2671
|
-
/// Enum that defines various errors that can occur during a readable code flow.
|
|
2672
|
-
typedef SWIFT_ENUM(NSInteger, GSKReadableCodeFlowError, open) {
|
|
2673
|
-
/// User has canceled the readable code flow
|
|
2674
|
-
GSKReadableCodeFlowUserCancelationError SWIFT_COMPILE_NAME("userCancellation") = 0,
|
|
2675
|
-
/// A general error due to a bad configuration parameter
|
|
2676
|
-
GSKReadableCodeFlowConfigurationError SWIFT_COMPILE_NAME("configuration") = 1,
|
|
2677
|
-
/// Camera permission was denied
|
|
2678
|
-
GSKReadableCodeFlowPermissionDeniedError SWIFT_COMPILE_NAME("permissionDenied") = 2,
|
|
2679
|
-
/// Failed to initialize the barcode detector
|
|
2680
|
-
GSKReadableCodeFlowDetectorError SWIFT_COMPILE_NAME("detectorError") = 3,
|
|
2681
|
-
};
|
|
2682
|
-
static NSString * _Nonnull const GSKReadableCodeFlowErrorDomain = @"GSSDK.GSKReadableCodeFlowError";
|
|
2683
|
-
|
|
2684
|
-
/// The result of a readable code scanning flow
|
|
2685
|
-
/// This class encapsulates the successful outcome of a readable code scanning session,
|
|
2686
|
-
/// containing the detected barcode or QR code data.
|
|
2687
|
-
SWIFT_CLASS("_TtC5GSSDK25GSKReadableCodeFlowResult")
|
|
2688
|
-
@interface GSKReadableCodeFlowResult : NSObject
|
|
2689
|
-
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
|
|
2690
|
-
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
|
|
2691
|
-
@end
|
|
2692
|
-
|
|
2693
|
-
@interface GSKReadableCodeFlowResult (SWIFT_EXTENSION(GSSDK))
|
|
2694
|
-
/// Returns a dictionary representation of the result
|
|
2695
|
-
/// The dictionary contains:
|
|
2696
|
-
/// <ul>
|
|
2697
|
-
/// <li>
|
|
2698
|
-
/// readableCodes: An array of code dictionaries, each containing:
|
|
2699
|
-
/// <ul>
|
|
2700
|
-
/// <li>
|
|
2701
|
-
/// value: The decoded string value
|
|
2702
|
-
/// </li>
|
|
2703
|
-
/// <li>
|
|
2704
|
-
/// type: The code type as a string (e.g., “qr”, “code128”)
|
|
2705
|
-
/// </li>
|
|
2706
|
-
/// </ul>
|
|
2707
|
-
/// </li>
|
|
2708
|
-
/// </ul>
|
|
2709
|
-
@property (nonatomic, readonly, copy) NSDictionary<NSString *, id> * _Nonnull dictionary;
|
|
2710
|
-
/// Returns a JSON representation of the result.
|
|
2711
|
-
/// See <code>dictionary</code> for an explanation of the JSON data’s structure.
|
|
2712
|
-
- (NSString * _Nonnull)json SWIFT_WARN_UNUSED_RESULT;
|
|
2713
|
-
@end
|
|
2714
|
-
|
|
2715
2935
|
typedef SWIFT_ENUM(NSInteger, GSKReceiptCategory, open) {
|
|
2716
2936
|
GSKReceiptCategoryGas = 0,
|
|
2717
2937
|
GSKReceiptCategoryTransportation = 1,
|
|
@@ -2730,9 +2950,15 @@ SWIFT_CLASS("_TtC5GSSDK13GSKReceiptVAT")
|
|
|
2730
2950
|
@end
|
|
2731
2951
|
|
|
2732
2952
|
@class GSKScanFlowConfiguration;
|
|
2733
|
-
/// A
|
|
2734
|
-
///
|
|
2735
|
-
///
|
|
2953
|
+
/// A UI-driven scan flow for turning physical documents into processed digital pages.
|
|
2954
|
+
/// Create an instance with <code>GSKScanFlowConfiguration</code> to choose the source
|
|
2955
|
+
/// (camera, photo library, or image URL), multi-page behavior, output format,
|
|
2956
|
+
/// filters, OCR, and structured-data extraction. Present the flow from a view
|
|
2957
|
+
/// controller and await a <code>GSKScanFlowResult</code> with the captured pages and the
|
|
2958
|
+
/// optional multi-page document.
|
|
2959
|
+
/// important:
|
|
2960
|
+
/// If you start a scan flow with the camera, your app must declare the
|
|
2961
|
+
/// <code>NSCameraUsageDescription</code> key in <code>Info.plist</code>.
|
|
2736
2962
|
SWIFT_CLASS("_TtC5GSSDK11GSKScanFlow")
|
|
2737
2963
|
@interface GSKScanFlow : NSObject
|
|
2738
2964
|
- (nonnull instancetype)initWithConfiguration:(GSKScanFlowConfiguration * _Nonnull)configuration OBJC_DESIGNATED_INITIALIZER;
|
|
@@ -2851,17 +3077,29 @@ SWIFT_CLASS("_TtC5GSSDK24GSKScanFlowConfiguration")
|
|
|
2851
3077
|
+ (nullable instancetype)configurationWithJSON:(NSString * _Nonnull)json error:(NSError * _Nullable * _Nullable)error SWIFT_WARN_UNUSED_RESULT;
|
|
2852
3078
|
@end
|
|
2853
3079
|
|
|
2854
|
-
/// Enum that defines various
|
|
2855
|
-
typedef SWIFT_ENUM(NSInteger,
|
|
3080
|
+
/// Enum that defines various numeric error codes that can occur during a scan flow.
|
|
3081
|
+
typedef SWIFT_ENUM(NSInteger, GSKScanFlowErrorCode, open) {
|
|
2856
3082
|
/// User has canceled the scan flow
|
|
2857
|
-
|
|
2858
|
-
/// A general error due to
|
|
3083
|
+
GSKScanFlowCancellationErrorCode SWIFT_COMPILE_NAME("cancellation") = 999,
|
|
3084
|
+
/// A general error due to an incorrect configuration. Verify that your
|
|
2859
3085
|
/// inputs match the API requirements.
|
|
2860
|
-
|
|
3086
|
+
GSKScanFlowConfigurationErrorCode SWIFT_COMPILE_NAME("configuration") = 1000,
|
|
3087
|
+
/// A licensing error. This is a developer error and you should contact the
|
|
3088
|
+
/// Genius Scan SDK support team to make sure you have a valid license key.
|
|
3089
|
+
GSKScanFlowLicensingErrorCode SWIFT_COMPILE_NAME("licensing") = 1001,
|
|
3090
|
+
/// An error that happened while capturing the scans. This can sometimes be recovered
|
|
3091
|
+
/// by restarting the device.
|
|
3092
|
+
GSKScanFlowCaptureErrorCode SWIFT_COMPILE_NAME("capture") = 1002,
|
|
3093
|
+
/// An error caused by low storage space. This can be recovered by cleaning up
|
|
3094
|
+
/// storage space and trying again.
|
|
3095
|
+
GSKScanFlowStorageSpaceErrorCode SWIFT_COMPILE_NAME("storageSpace") = 1003,
|
|
3096
|
+
/// An internal error. This is a catch-all category, and the underlying error will
|
|
3097
|
+
/// give more details.
|
|
3098
|
+
GSKScanFlowInternalErrorCode SWIFT_COMPILE_NAME("internal") = 9999,
|
|
2861
3099
|
};
|
|
2862
3100
|
|
|
2863
3101
|
/// The different possible filters for the scanner UI.
|
|
2864
|
-
///
|
|
3102
|
+
/// Each case maps to a predefined filter configuration except <code>.automatic</code>.
|
|
2865
3103
|
typedef SWIFT_ENUM(NSInteger, GSKScanFlowFilterType, open) {
|
|
2866
3104
|
GSKScanFlowFilterNone SWIFT_COMPILE_NAME("none") = 0,
|
|
2867
3105
|
/// Automatic filter
|
|
@@ -2902,8 +3140,8 @@ typedef SWIFT_ENUM(NSUInteger, GSKScanFlowFlashMode, open) {
|
|
|
2902
3140
|
/// The format of the exported document.
|
|
2903
3141
|
typedef SWIFT_ENUM(NSUInteger, GSKScanFlowMultiPageFormat, open) {
|
|
2904
3142
|
GSKScanFlowNone SWIFT_COMPILE_NAME("none") = 0,
|
|
2905
|
-
GSKScanFlowPDF SWIFT_COMPILE_NAME("
|
|
2906
|
-
GSKScanFlowTIFF SWIFT_COMPILE_NAME("
|
|
3143
|
+
GSKScanFlowPDF SWIFT_COMPILE_NAME("pdf") = 1,
|
|
3144
|
+
GSKScanFlowTIFF SWIFT_COMPILE_NAME("tiff") = 2,
|
|
2907
3145
|
};
|
|
2908
3146
|
|
|
2909
3147
|
/// The configuration for text recognition
|
|
@@ -2942,9 +3180,9 @@ typedef SWIFT_ENUM(NSUInteger, GSKScanFlowPDFPageSize, open) {
|
|
|
2942
3180
|
SWIFT_CLASS("_TtC5GSSDK17GSKScanFlowResult")
|
|
2943
3181
|
@interface GSKScanFlowResult : NSObject
|
|
2944
3182
|
/// Document containing the pages that were scanned during the scan
|
|
2945
|
-
/// flow. The format is specified by <code>multiPageFormat</code> property of
|
|
2946
|
-
/// the
|
|
2947
|
-
///
|
|
3183
|
+
/// flow. The format is specified by the <code>multiPageFormat</code> property of
|
|
3184
|
+
/// the <code>GSKScanFlowConfiguration</code> used for the scan flow. This is <code>nil</code>
|
|
3185
|
+
/// when <code>multiPageFormat</code> is <code>.none</code> or if document generation failed.
|
|
2948
3186
|
@property (nonatomic, copy) NSURL * _Nullable multiPageDocumentURL;
|
|
2949
3187
|
/// The individual scans taken during the scan flow.
|
|
2950
3188
|
/// Each scan object contains both the original and the enhanced scans.
|
|
@@ -2977,7 +3215,7 @@ SWIFT_CLASS("_TtC5GSSDK15GSKScanFlowScan")
|
|
|
2977
3215
|
/// If OCR was performed, the recognized text.
|
|
2978
3216
|
@property (nonatomic, strong) GSKScanFlowOCRResult * _Nullable ocrResult;
|
|
2979
3217
|
/// If structured data extraction was performed, the structured data.
|
|
2980
|
-
@property (nonatomic, strong) GSKScanFlowStructuredDataResult * _Nullable
|
|
3218
|
+
@property (nonatomic, strong) GSKScanFlowStructuredDataResult * _Nullable structuredData;
|
|
2981
3219
|
- (nonnull instancetype)initWithOriginalFilePath:(NSString * _Nonnull)originalFilePath enhancedFilePath:(NSString * _Nonnull)enhancedFilePath OBJC_DESIGNATED_INITIALIZER;
|
|
2982
3220
|
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
|
|
2983
3221
|
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
|
|
@@ -3007,6 +3245,8 @@ SWIFT_CLASS("_TtC5GSSDK31GSKScanFlowStructuredDataResult")
|
|
|
3007
3245
|
/// Present if receipt extraction was requested and a receipt/invoice was
|
|
3008
3246
|
/// successfully extracted, <code>nil</code> otherwise.
|
|
3009
3247
|
@property (nonatomic, strong) GSKStructuredDataReceipt * _Nullable receipt;
|
|
3248
|
+
/// Present if barcode extraction was requested and codes were successfully extracted, empty otherwise.
|
|
3249
|
+
@property (nonatomic, copy) NSArray<GSKBarcode *> * _Nonnull barcodes;
|
|
3010
3250
|
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
|
3011
3251
|
@end
|
|
3012
3252
|
|
|
@@ -3146,23 +3386,19 @@ SWIFT_CLASS("_TtC5GSSDK13GSKTextLayout")
|
|
|
3146
3386
|
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
|
|
3147
3387
|
@end
|
|
3148
3388
|
|
|
3149
|
-
|
|
3389
|
+
/// Converts an OCR text layout into plain text.
|
|
3390
|
+
/// A <code>GSKOCRResult</code> contains both raw text and a <code>GSKTextLayout</code>, which preserves spatial information such as
|
|
3391
|
+
/// bounding boxes and line/word positions. This converter reconstructs the raw text from a <code>GSKTextLayout</code> by
|
|
3392
|
+
/// traversing its bounding boxes in reading order and grouping content into paragraphs.
|
|
3393
|
+
/// Use this when you want to retain only the spatial representation (for highlighting, selection, reflow, etc.)
|
|
3394
|
+
/// and regenerate the plain-text representation on demand, rather than storing both.
|
|
3150
3395
|
SWIFT_CLASS("_TtC5GSSDK28GSKTextLayoutToTextConverter")
|
|
3151
3396
|
@interface GSKTextLayoutToTextConverter : NSObject
|
|
3152
|
-
- (GSKTextLayoutToTextConverterResult * _Nullable)convert:(GSKTextLayout * _Nonnull)textLayout error:(NSError * _Nullable * _Nullable)error SWIFT_WARN_UNUSED_RESULT;
|
|
3153
3397
|
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
|
3154
3398
|
@end
|
|
3155
3399
|
|
|
3156
3400
|
SWIFT_CLASS("_TtC5GSSDK34GSKTextLayoutToTextConverterResult")
|
|
3157
3401
|
@interface GSKTextLayoutToTextConverterResult : NSObject
|
|
3158
|
-
/// The text reconstructed from the text layout.
|
|
3159
|
-
@property (nonatomic, readonly, copy) NSString * _Nonnull text;
|
|
3160
|
-
/// The average word confidence of the recognized text.
|
|
3161
|
-
/// A value between 0 and 100
|
|
3162
|
-
@property (nonatomic, readonly) NSInteger averageWordConfidence;
|
|
3163
|
-
/// The number of words in the recognized text.
|
|
3164
|
-
/// This is the number of words on which the average word confidence has been computed.
|
|
3165
|
-
@property (nonatomic, readonly) NSInteger wordCount;
|
|
3166
3402
|
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
|
|
3167
3403
|
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
|
|
3168
3404
|
@end
|
|
@@ -3175,12 +3411,6 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) GSKUIBackgro
|
|
|
3175
3411
|
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
|
3176
3412
|
@end
|
|
3177
3413
|
|
|
3178
|
-
@interface GSKView (SWIFT_EXTENSION(GSSDK))
|
|
3179
|
-
- (void)startSearchAnimation;
|
|
3180
|
-
- (void)startSnapAnimationWithDuration:(NSTimeInterval)duration;
|
|
3181
|
-
- (void)endSnapAnimation;
|
|
3182
|
-
@end
|
|
3183
|
-
|
|
3184
3414
|
SWIFT_CLASS("_TtC5GSSDK14GSSDKResources")
|
|
3185
3415
|
@interface GSSDKResources : NSObject
|
|
3186
3416
|
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) NSBundle * _Nonnull bundle;)
|