DBCamera
DBCamera copied to clipboard
Camera layer black
Hi, I was playing around, keeping a DBCameraView controller around after removing the reset in viewDidDiseapear/Apear, and the camera somehow diseapeared, I can not reproduce the problem, any clue ?
@RomainPln i'll take a look. Thanks for the suggest.
which reset are you talking about? I seems to have a similar issue of camera preview layer went black too.
I was working on adding overlay image functionality to the DBCameraViewController. I found out the cause was because I added another layer to the previewLayer
and it blocks the main thread and somehow makes the previewLayer
to go black. I solved it by delaying out that execution.
See next answer.
Hope that helps :)
@danielebogo I'm planning to send a PR for this overlay functionality as well. I think it should be useful to somebody. Please have a look. :)
Sorry, after some more testing that method still doesn't solve it completely. It only works sometimes. Adding some more delay should nail it.
[self.cameraView.previewLayer performSelector:@selector(addSublayer:)
withObject:self.overlayImageView.layer
afterDelay:0.5];