ARKit ARCoachingOverlayView ”Start Over” button in relocalizing not working

The method

Code Block
func coachingOverlayViewDidRequestSessionReset(_ coachingOverlayView: ARCoachingOverlayView)

is never called when I conform to the ARCoachingOverlayViewDelegate protocol. The two other methods coachingOverlayViewWillActivate and coachingOverlayViewDidDeactivate are called correctly. The "Start Over" button which is displayed during relocalization is clickable, but the event does not trigger any action when tapped. Weirdly enough, sometimes the event will trigger, but then it is often up to 20 seconds after being clicked.

I am declaring my coachingoverlay like so

Code Block
private let coachingOverlay = ARCoachingOverlayView()


In viewDidLoad I perform the setup

Code Block
func setupCoachingOverlay() {
coachingOverlay.session = sceneView.session
coachingOverlay.delegate = self
coachingOverlay.translatesAutoresizingMaskIntoConstraints = false
sceneView.addSubview(coachingOverlay)
NSLayoutConstraint.activate([
coachingOverlay.centerXAnchor.constraint(equalTo: view.centerXAnchor),
coachingOverlay.centerYAnchor.constraint(equalTo: view.centerYAnchor),
coachingOverlay.widthAnchor.constraint(equalTo: view.widthAnchor),
coachingOverlay.heightAnchor.constraint(equalTo: view.heightAnchor)
])
coachingOverlay.activatesAutomatically = true
}


And I conform to the protocol

Code Block
extension ARView: ARCoachingOverlayViewDelegate {


I’ve basically followed how it is done in the Apple example project, where this problem is not an issue, but I can’t find the issue.
https://developer.apple.com/documentation/arkit/world_tracking/placing_objects_and_handling_3d_interaction

I’ve tried on devices using iPhone 7, 11 and 11 Pro with iOS 13 and iOS 14 beta, all experience the same problem.

I love this functionality but with this problem it unfortunately can not be used in production code.

What may be the problem?



ARKit ARCoachingOverlayView ”Start Over” button in relocalizing not working
 
 
Q