Now that we have our label to display messages to the user, let's use the session methods we already have in our ViewController class and create new ones to display useful information, as shown in the following steps:
- In the ViewController.swift file, within the didFailWithError session, add a new message:
func session(_ session: ARSession, didFailWithError error: Error) { infoLabel.text = "Session failed : \(error.localizedDescription)."}
This message will appear when there is an error in the ARSession.
- In the sessionWasInterrupted method, add the following message:
func sessionWasInterrupted(_ session: ARSession) { infoLabel.text = "Session was interrupted."}
This will be executed when the session is ...