I'm using Apple Demonstration Project for placing 3d objects. And BarcodeScanner to read UPC code and then use it to download the model from Firebase. My problem is that after returning from ARKit screen with popViewController
(i've also tried to use pushViewController
or even smth like that:
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let vc = storyboard.instantiateViewController(withIdentifier: "UPCScanner")
var viewcontrollers = self.navigationController?.viewControllers
viewcontrollers?.removeAll()
viewcontrollers?.append(vc)
self.navigationController?.setViewControllers(viewcontrollers!, animated: true)
BarcodeScanner camera just blur everything that is too close to it. Here are few screenshots: Normal BarcodeScanner camera, ARKit camera, BarcodeScanner camera after using ARKit. And also the project Github link, i've changed the code, so now it's giving the model after reading any UPC.
Also would like to add that i thought that the problem could be somewhere in the setup function in SceneExtensions.swift
, but commenting it did't work.
UPD: I made camera not blurring everything that is too close to it by adding the function to focus it on the touch and it started to work when the flash is turn on. But still didn't work when it isn't.
UPD2: It works not only with flash lighting, but with just better lighting too, so the problem is still with focusing. I guess smth's changing during the AR session, but still didn't understand what.
UPD3: It turned out that the focusing camera function is helping if the lighting is good, so that's the best solution I had found.