Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UPC-A support #29

Open
yporubov opened this issue Jul 31, 2015 · 1 comment
Open

UPC-A support #29

yporubov opened this issue Jul 31, 2015 · 1 comment

Comments

@yporubov
Copy link

Thank you so much for the barcode generator.

From "AVMetadataObjectTypeEAN13Code" description: AVMetadataMachineReadableCodeObject instances generated from EAN-13 (including UPC-A) codes return this identifier as the type.

The barcode does have length 12 digits, like 123456789012. EAN-13 barcode does have 13 digits
isContentsValid method returns NO because contents.length == self.length is not TRUE. (12 != 13)
As workaround I added one zero before barcode (0123456789012) and it works for me.
[CodeGen genCodeWithContents:@"0123456789012" machineReadableCodeObjectType:objectType]

But could you please add zero inside API ?

@Reinoal
Copy link

Reinoal commented Dec 13, 2015

首先感谢你的分享,我使用的版本是0.1.4
在扫描二维码的结束,controller被退出之后alert会被多次调用并显示。怎么解决这个问题: if (barcodeObjects.count > 0) {
[barcodeObjects enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
dispatch_async(dispatch_get_main_queue(), ^{
AVMetadataMachineReadableCodeObject *code = obj;
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Barcode found"
message:code.stringValue
delegate:self
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
dispatch_async(dispatch_get_main_queue(), ^{
[scanner dismissViewControllerAnimated:true completion:nil];
[alert show];
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants