BRScanResultsDelegate
Objective-C
@protocol BRScanResultsDelegate <NSObject>
Swift
protocol BRScanResultsDelegate : NSObjectProtocol
Implement this protocol to receive callbacks from a scanning session
-
Indicates that the scanning session has ended
Declaration
Objective-C
- (void)didFinishScanning:(UIViewController *)cameraViewController withScanResults:(BRScanResults *)scanResults;
Swift
optional func didFinishScanning(_ cameraViewController: UIViewController!, with scanResults: BRScanResults!)
Parameters
cameraViewController
The subclass of
BRCameraViewController
to dismissscanResults
The results of the scanning session
-
Indicates that the scanning session has been cancelled
Declaration
Objective-C
- (void)didCancelScanning:(UIViewController *)cameraViewController;
Swift
optional func didCancelScanning(_ cameraViewController: UIViewController!)
Parameters
cameraViewController
The subclass of
BRCameraViewController
to dismiss -
If
BRScanOptions.returnRawText
was enabled, this callback will be invoked after each scanned frame with raw OCR resultsDeclaration
Objective-C
- (void)didOutputRawText:(NSString *)rawText;
Swift
optional func didOutputRawText(_ rawText: String!)
Parameters
rawText
The raw OCR results
-
This callback indicates an error occurred during scanning
Declaration
Objective-C
- (void)scanningErrorOccurred:(NSError *)error;
Swift
optional func scanningErrorOccurred(_ error: (any Error)!)
Parameters
error
The error that occurred during scanning
-
This callback provides encrypted debugging information that can be used to help identify crashes. For example, if the client app uses Firebase Crashlytics, this can be passed along as follows:
[[FIRCrashlytics crashlytics] log:debugInfo];
Declaration
Objective-C
- (void)didOutputDebugInfo:(NSString *)debugInfo;
Swift
optional func didOutputDebugInfo(_ debugInfo: String!)
Parameters
debugInfo
The encrypted debugging information
-
This callback provides debugging information as key value pairs. For example, if the client app uses Firebase Crashlytics, this can be passed as a custom attribute as follows:
[[FIRCrashlytics crashlytics] setCustomValue:val forKey:key];
Declaration
Objective-C
- (void)didOutputDebugKey:(NSString *)key withValue:(id)val;
Swift
optional func didOutputDebugKey(_ key: String!, withValue val: Any!)
Parameters
key
Description of the type of debugging information
val
The information itself