Question

I have a small issue with the ZXingWidgetController, if I present the controller using a navigation controller, the view will get pushed right away, however there will be a blank screen for about 1.5 seconds, and then the AVCapture starts. Yet if I present it as a modal, the AVCapture starts as soon as the modal is presented.

I have tampered with the WidgetController quite a bit, as I need to read other kinds of barcodes using the same AVCapture window, and that is working perfectly fine. I though that might be the issue, but after trying the SampleTest that comes with the unmodified WidgetController, and pushing it in a nav controller the behavior is the same. So that is not the problem.

I have tried called the push with a delay, but after the delay the view is still pushed and a blank screen comes up first.

Has anyone dealt with this?

Was it helpful?

Solution 2

Got back to work today, and looked closely at the code... the problem is actually very simple, the AVCapture start method is getting called in the viewDidAppear method, I moved it to the viewWillAppear method and problem solved :)

OTHER TIPS

Do you have a demo that shows this?

I can't think of any reason it would matter how the controller is presented. It is the case that loading AVFF takes time so the first time you present something it takes longer. And the ZXWdidgetController doesn't save the AVFF objects: it creates and deletes them whenever the view appears and disappears. But all of these things should be the same regardless of the way the widget is presented as long as it's compared first vs non first.

In general, the capture usually shows an old image briefly while the AVFF starts the camera. This is pretty much true of all camera related apps as far as I know (and would be happy to be corrected.) But I don't think it's usually anything like 1500 ms.

Note that delays are even more pronounced running under the debugger, presumably because it's loading symbols etc as the framework is loaded.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top