Skip to content

Commit

Permalink
Doesn't display the overlay until you can close Vuforia. (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
Stending authored and mattrayner committed Jul 25, 2016
1 parent 0b70fb2 commit 9d92e42
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/ios/ImageTargets/ImageTargetsViewController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
self.title = @"Image Targets";

// get whether the user opted to show the device icon
bool showDevicesIcon = [[self.overlayOptions objectForKey:@"showDevicesIcon"] integerValue];

// Create the EAGLView with the screen dimensions
CGRect screenBounds = [[UIScreen mainScreen] bounds];
Expand Down Expand Up @@ -89,8 +88,20 @@ - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
selector:@selector(resumeAR)
name:UIApplicationDidBecomeActiveNotification
object:nil];
[self loadOverlay];
}
return self;
}

-(void) loadOverlay {
if(!vapp.cameraIsStarted){
[self performSelector:@selector(loadOverlay) withObject:nil afterDelay:0.1];
}else{

// set up the overlay back bar

bool showDevicesIcon = [[self.overlayOptions objectForKey:@"showDevicesIcon"] integerValue];

UIView *vuforiaBarView=[[UIView alloc]initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, 75)];
vuforiaBarView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.5f];
vuforiaBarView.tag = 8;
Expand Down Expand Up @@ -162,7 +173,6 @@ - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
}
}
}
return self;
}

-(void)buttonPressed {
Expand Down Expand Up @@ -614,7 +624,7 @@ - (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIVi
if(!self.delaying) {
self.delaying = true;

[self performSelector:@selector(startVuforia) withObject:nil afterDelay:1];

}

CGRect mainBounds = [[UIScreen mainScreen] bounds];
Expand Down

0 comments on commit 9d92e42

Please sign in to comment.