ARSCNView session method is called, but renderer is not.

I'm trying to create custom ARSCNView.

class CustomARSCNView: ARSCNView, ARSessionDelegate, ARSCNViewDelegate {

    override init(frame: CGRect) {
        super.init(frame: frame)
        loadWorldMap()
    }

    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
        loadWorldMap()
    }

    override init(frame: CGRect, options: [String : Any]? = nil) {
        super.init(frame: frame, options: options)
        loadWorldMap()
    }

    public func loadWorldMap () {
        let config = ARWorldTrackingConfiguration()
        config.planeDetection = .horizontal
        config.environmentTexturing = .automatic
        self.debugOptions = [ARSCNDebugOptions.showFeaturePoints, .showWorldOrigin]

        session.run(config, options: [.resetTracking, .removeExistingAnchors])
        self.session.delegate = self
    }
}

Everything works pretty cool, any attached session method is called predictably, but unfortunately renderer methods not running at all. Is there any mistake in my code?

Answered by mmaattii in 682842022

I didn't know I also need to delegate self. It solved this issue

Accepted Answer

I didn't know I also need to delegate self. It solved this issue

ARSCNView session method is called, but renderer is not.
 
 
Q