csZBar
csZBar copied to clipboard
Create parameter for "Cancel" button
It would be great if we could define "Cancel" button translation from calling the plugin from our function.
thank you Davor
+1. When I press the back button of my phone and error callback fires
@LTroya your issue is simply not handling cancel correctly - unrelated to @davorpeic's request:
Check if the error callback's argument is exactly "cancelled":
error('cancelled')
If user cancelled the scan (with back button etc)
@davorpeic agreed this would be a good addition. Filed for addition when I have time to do so.
In CsZbar.m:
UIButton *cancelButton = [[[[[[[self.scanReader.view.subviews objectAtIndex:2] subviews] objectAtIndex:0] subviews] objectAtIndex:2] subviews] objectAtIndex:0];
[cancelButton setTitle:@"Whatever you want" forState:UIControlStateNormal];
Hey all,
looks like https://github.com/tjwoon/csZBar/pull/78 has broken this fix.
I'm no good on the native side but have got things working by replacing
UIButton *cancelButton = [[[[[[[self.scanReader.view.subviews objectAtIndex:2] subviews] objectAtIndex:0] subviews] objectAtIndex:2] subviews] objectAtIndex:0];
with
UIButton *cancelButton = [[[[[[[self.scanReader.view.subviews objectAtIndex:2] subviews] objectAtIndex:0] subviews] objectAtIndex:infoButtonIndex-1] subviews] objectAtIndex:0];
Hope this helps someone