I've seen people running ARKit with ARSCNView
, and they're able to fetch said a QR code rectangle in the camera and render something at the position somehow related to the place QR code resided in the space. I thought they did it by delegating AVCaptureMetadataOutputObjectsDelegate
, so I went ahead and attempt to achieve the following logic:
Running
ARSCNViewDelegate
,ARSessionDelegate
andAVCaptureMetadataOutputObjectsDelegate
at the same time.Wire up an
ARSCNView
, delegate the view and its session to self.Wire up an
AVCaptureSession
, delegate it to self, and start the session.Start the
ARSCNView
session, since the official example did this inviewWillAppear()
, I did the same thing.
The application did run without any error, but I could only get a few callbacks from AVCaptureMetadataOutputObjectsDelegate
, like 3 to 5, and then it would never be called again like the delegate of ARSession
seized its authority, was I implementing the wrong approach or you just can't delegate ARSession
and AVCaptureSession
at the same time?