Skip to content

Commit

Permalink
Merge pull request tjwoon#78 from eladmoshe/master
Browse files Browse the repository at this point in the history
Fixed issue that cause app to crash on iOS 10
  • Loading branch information
dcousens authored Jul 31, 2016
2 parents dd29b05 + 894cb50 commit 9865024
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ios/CsZBar.m
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,13 @@ - (void)scan: (CDVInvokedUrlCommand*)command;
}

// Hack to hide the bottom bar's Info button... originally based on http://stackoverflow.com/a/16353530
UIView *infoButton = [[[[[self.scanReader.view.subviews objectAtIndex:2] subviews] objectAtIndex:0] subviews] objectAtIndex:3];
NSInteger infoButtonIndex;
if ([[[UIDevice currentDevice] systemVersion] compare:@"10.0" options:NSNumericSearch] != NSOrderedAscending) {
infoButtonIndex = 1;
} else {
infoButtonIndex = 3;
}
UIView *infoButton = [[[[[self.scanReader.view.subviews objectAtIndex:2] subviews] objectAtIndex:0] subviews] objectAtIndex:infoButtonIndex];
[infoButton setHidden:YES];

//UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem]; [button setTitle:@"Press Me" forState:UIControlStateNormal]; [button sizeToFit]; [self.view addSubview:button];
Expand Down

0 comments on commit 9865024

Please sign in to comment.