HERE iOS SDK Developer's Guide

LiveSight

LiveSight enables user experiences that use the real world as an interface. With LiveSight, developers can overlay geospatial content on the real world, which is displayed using the device's camera. Additionally, an immersive experience is created by using the device's sensors to track movement in space and update the view accordingly.

The key concepts covered in this section include adding LiveSight to an iOS application, starting LiveSight in Camera Mode, and customizing the LiveSight experience. The classes covered include NMACompositeView and NMAARController.

LiveSight requires iOS users to grant your application access to the back camera. If the camera is not available, the NMAARErrorCameraAccessNotAuthorized error code is returned when starting LiveSight.

NMACompositeView

The UIView subclass related to LiveSight functionality is the NMACompositeView. NMACompositeView exposes LiveSight functionality in one iOS UI component. For the remainder of this section, we use the NMACompositeView in code samples and discussions.

Note: NMACompositeView does not support a map view. As such, the composite view only supports LiveSight, and it is rendered as a black screen until LiveSight is started. Support for using the map view along with the camera view, will be added to NMACompositeView in a future release.

Adding and Initializing the NMACompositeView

The first step to integrate LiveSight functionality into an application is to insert a NMACompositeView into the view layout. This is accomplished by adding NMACompositeView subview to the current iOS view.

As with other UIView objects, the NMACompositeView must be initialized by calling the initWithFrame: method. During this asynchronous initialization, the NMAARController is also created. More information about the NMAARController can be found in Customizing LiveSight.

Starting and Stopping LiveSight

To control LiveSight, two methods from NMAARController, start and stopWithAnimation:, are used. You can call the start method after creating the composite view to trigger the LiveSight Mode. Calling start while already in LiveSight Mode results in the NMAARErrorInvalidOperation error code being returned. Use the stopWithAnimation: method to stop the LiveSight.

Figure 1. LiveSight