Loading...
Searching...
No Matches
<NCPositionListener> Protocol Reference

Class provides a callback to be invoked when NavigationManager updates the position of the device. More...

#include <com/navigine/idl/objc/NCPositionListener.h>

+ Inheritance diagram for <NCPositionListener>:

Instance Methods

(void) - onPositionUpdated:
 Called when new position has been calculated.
 
(void) - onPositionError:
 Called if unable to calculate user's position.
 

Detailed Description

Class provides a callback to be invoked when NavigationManager updates the position of the device.

Referenced from NavigationManager RouteManager.

Note
The callback is invoked in the UI thread.

Definition at line 20 of file NCPositionListener.h.

Method Documentation

◆ onPositionError:

- (void) onPositionError: (nullable NSError *) error

Called if unable to calculate user's position.

Parameters
errorhandled error.

Swift code snippet:

func onPositionError(_ error: Error?) {
if let error = error {
print("Position error: \‍(error.localizedDescription)")
}
}

Objective C code snippet:

- (void)onPositionError:(NSError *)error {
NSLog(@"Position error: %@", error.localizedDescription);
}

◆ onPositionUpdated:

- (void) onPositionUpdated: (nonnull NCPosition *) position

Called when new position has been calculated.

Parameters
positioncurrent user Position.

Swift code snippet:

func onPositionUpdated(_ position: NCPosition) {
print("Position updated successfully")
demonstratePositionUsage(position)
}

Objective C code snippet:

- (void)onPositionUpdated:(NCPosition *)position {
NSLog(@"Position updated successfully");
[self demonstratePositionUsage:position];
}

The documentation for this protocol was generated from the following file: