Sending notifications to the user

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:

  1. 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.

  1. 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 ...

Get Enterprise Augmented Reality Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.