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

Need to stop reading #1

Open
Parkyprg opened this issue Nov 10, 2016 · 3 comments
Open

Need to stop reading #1

Parkyprg opened this issue Nov 10, 2016 · 3 comments

Comments

@Parkyprg
Copy link

Good job with this reader.

However, there only a method to start reading, but not to stop.
I am using it in a UITabBarController and if I change the tab, it will still read. I need to stop it when the view disappears.

Thank you

@VivekVithlani
Copy link
Owner

VivekVithlani commented Nov 21, 2016

Thank you for using my framework.

You need to remove [qrCodeView startReading]; method from "M2" QRCodeReaderDelegate method.

i.e.
`- (void)getQRCodeData:(id)qRCodeData {
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"QR Code" message:qRCodeData preferredStyle:UIAlertControllerStyleAlert];

UIAlertAction *cancel = [UIAlertAction actionWithTitle:@"Close" style:UIAlertActionStyleDefault handler:nil];
[alertController addAction:cancel];

UIAlertAction *reScan = [UIAlertAction actionWithTitle:@"Rescan" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {

[qrCodeView startReading]; // Remove this line

}];
[alertController addAction:reScan];
[self presentViewController:alertController animated:YES completion:nil];
}`

When the view disappears you need to put this code
qrCodeView = nil;

If you still facing any issue or any scenario please let me know,
Thank you.

@Parkyprg
Copy link
Author

Thank you for your reply. However, this is not helping too much.
Consider this scenario:
I have a UITabBarController and one of the UIViewControllers have this QRCode reader.
If I switch between controllers, I have to stop reading codes, otherwise, even if the page is not active, the codes are still scanned.

I got this working by destroying the component when the view will disappear.

But unfortunately I had to use a different framework, because this was build only for arm64 architecture and I needed for armv7 and armv7s too and there was no reply from your side for some time.

@VivekVithlani
Copy link
Owner

Ok

@VivekVithlani VivekVithlani reopened this Jun 27, 2017
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