I am new to programming, so this question I'm sure is extremely basic (bear with me!)
I just installed zxing into my current xcode 4.5 project. It took me a while to get through the errors, but I finally got it.
I created a button called "scan" where I want zxing to be called. How can I make this happen?
I've tried looking at the files I implemented into my source files but cannot figure out which classes and method to use.
And yes, I tried a google search on this extremely basic concept but found nothing :(
Here is the code you need to add in your scan button action.
- (IBAction)scanPressed:(id)sender
{
ZXingWidgetController *widController = [[ZXingWidgetController alloc] initWithDelegate:self showCancel:YES OneDMode:NO];
NSMutableSet *readers = [[NSMutableSet alloc ] init];
<#if ZXQR>
QRCodeReader* qrcodeReader = [[QRCodeReader alloc] init];
[readers addObject:qrcodeReader];
<#endif>
<#if ZXAZ>
AztecReader *aztecReader = [[AztecReader alloc] init];
[readers addObject:aztecReader];
<#endif>
widController.readers = readers;
[self presentModalViewController:widController animated:YES];
}
remove the "<>" signs before use this code in your app.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With