I am trying to add a camera capture subview on top of my NavigationStack but even though the code runs fine according to debugs the subview is not shown on top so I cannot scan using the camera
The code looks as follows, why would it not show on top of the stack?
- (IBAction)transactionListViewCameraBtn_Pressed:(id)sender {
if([NWTillHelper isDebug] == 1) {
NSLog(@"%s entered", __PRETTY_FUNCTION__);
}
NSLog(@"jongel1");
self.capture.delegate = self;
NSLog(@"jongel2");
[self applyOrientation];
NSLog(@"jongel3");
self.capture = [[ZXCapture alloc] init];
self.capture.camera = self.capture.back;
self.capture.focusMode = AVCaptureFocusModeContinuousAutoFocus;
NSLog(@"jongel4");
[self.view.layer addSublayer:self.capture.layer];
NSLog(@"jongel5");
[self.view bringSubviewToFront:self.scanRectView];
[self.view bringSubviewToFront:self.decodedLabel];
NSLog(@"jongel6");
}
Seem like you set delegate
for self.capture
before initializing self.capture
. Try to set delegate
after you initialize self.capture
.