mirror of
https://github.com/simplezhli/flutter_barcode_reader.git
synced 2024-11-23 03:39:22 +08:00
changed delegate method name to 'didFailWithErrorCode'
This commit is contained in:
parent
1c34da8db9
commit
65193acf1c
@ -32,7 +32,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (void)barcodeScannerViewController:(BarcodeScannerViewController *)controller didScanBarcodeWithErrorCode:(NSString *)errorCode {
|
||||
- (void)barcodeScannerViewController:(BarcodeScannerViewController *)controller didFailWithErrorCode:(NSString *)errorCode {
|
||||
if (self.result){
|
||||
self.result([FlutterError errorWithCode:errorCode
|
||||
message:nil
|
||||
|
@ -38,7 +38,7 @@
|
||||
if (success) {
|
||||
[self startScan];
|
||||
} else {
|
||||
[self.delegate barcodeScannerViewController:self didScanBarcodeWithErrorCode:@"PERMISSION_NOT_GRANTED"];
|
||||
[self.delegate barcodeScannerViewController:self didFailWithErrorCode:@"PERMISSION_NOT_GRANTED"];
|
||||
[self dismissViewControllerAnimated:NO completion:nil];
|
||||
}
|
||||
}];
|
||||
|
@ -9,6 +9,6 @@
|
||||
@protocol BarcodeScannerViewControllerDelegate <NSObject>
|
||||
|
||||
- (void)barcodeScannerViewController:(BarcodeScannerViewController *)controller didScanBarcodeWithResult:(NSString *)result;
|
||||
- (void)barcodeScannerViewController:(BarcodeScannerViewController *)controller didScanBarcodeWithErrorCode:(NSString *)errorCode;
|
||||
- (void)barcodeScannerViewController:(BarcodeScannerViewController *)controller didFailWithErrorCode:(NSString *)errorCode;
|
||||
|
||||
@end
|
||||
|
Loading…
Reference in New Issue
Block a user