优化扫码
This commit is contained in:
parent
64971f325f
commit
93f273ed81
@ -24,15 +24,13 @@
|
|||||||
static QRCodeReaderViewController *vc = nil;
|
static QRCodeReaderViewController *vc = nil;
|
||||||
static dispatch_once_t onceToken;
|
static dispatch_once_t onceToken;
|
||||||
|
|
||||||
// dispatch_once(&onceToken, ^{
|
|
||||||
//
|
|
||||||
// });
|
|
||||||
|
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
// if we are active again, we don't need to do this anymore
|
// if we are active again, we don't need to do this anymore
|
||||||
|
if (vc == nil) {
|
||||||
QRCodeReader *reader = [QRCodeReader readerWithMetadataObjectTypes:@[AVMetadataObjectTypeQRCode]];
|
QRCodeReader *reader = [QRCodeReader readerWithMetadataObjectTypes:@[AVMetadataObjectTypeQRCode]];
|
||||||
vc = [QRCodeReaderViewController readerWithCancelButtonTitle:@"Cancel" codeReader:reader startScanningAtLoad:YES showSwitchCameraButton:YES showTorchButton:YES];
|
vc = [QRCodeReaderViewController readerWithCancelButtonTitle:@"Cancel" codeReader:reader startScanningAtLoad:YES showSwitchCameraButton:YES showTorchButton:YES];
|
||||||
vc.modalPresentationStyle = UIModalPresentationFormSheet;
|
vc.modalPresentationStyle = UIModalPresentationFormSheet;
|
||||||
|
}
|
||||||
|
|
||||||
[vc setCompletionWithBlock:^(NSString *resultAsString) {
|
[vc setCompletionWithBlock:^(NSString *resultAsString) {
|
||||||
NSLog(@"Completion with result: %@", resultAsString);
|
NSLog(@"Completion with result: %@", resultAsString);
|
||||||
|
Binary file not shown.
@ -206,8 +206,8 @@
|
|||||||
filePath = "Classes_cocos/UIViewController+Wallet.mm"
|
filePath = "Classes_cocos/UIViewController+Wallet.mm"
|
||||||
startingColumnNumber = "9223372036854775807"
|
startingColumnNumber = "9223372036854775807"
|
||||||
endingColumnNumber = "9223372036854775807"
|
endingColumnNumber = "9223372036854775807"
|
||||||
startingLineNumber = "46"
|
startingLineNumber = "44"
|
||||||
endingLineNumber = "46"
|
endingLineNumber = "44"
|
||||||
landmarkName = "-scanQRCode:"
|
landmarkName = "-scanQRCode:"
|
||||||
landmarkType = "7">
|
landmarkType = "7">
|
||||||
</BreakpointContent>
|
</BreakpointContent>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user