Loading...
Searching...
No Matches
NCLocationListManager Class Reference

Class is used for downloading locations list from the server and providing it to the user. More...

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

Inherits NSObject.

Instance Methods

(void) - addLocationListListener:
 Method is used to add LocationListListener element which will notify about newly downloaded list of available locations.
 
(void) - removeLocationListListener:
 Method is used for removing previously added LocationListListener class element.
 
(void) - updateLocationList
 Method is used to force reload location list.
 
(nonnull NSDictionary< NSNumber *, NCLocationInfo * > *) - getLocationList
 Method is used to get current location list LocationInfo.
 

Detailed Description

Class is used for downloading locations list from the server and providing it to the user.

Referenced from NavigineSdk.

Definition at line 19 of file NCLocationListManager.h.

Method Documentation

◆ addLocationListListener:

- (void) addLocationListListener: (nullable id< NCLocationListListener >) listener

Method is used to add LocationListListener element which will notify about newly downloaded list of available locations.

Note
Do not forget to remove listener if it is no longer needed!
Parameters
listenerСorresponding LocationListListener class.

Swift code snippet:

// Add location list listener
manager.addLocationListListener(listener)
print("Added location list listener")

Objective C code snippet:

// Add location list listener
[self.locationListManager addLocationListListener:self.locationListListener];
NSLog(@"Added location list listener");

◆ getLocationList

- (nonnull NSDictionary< NSNumber *, NCLocationInfo * > *) getLocationList

Method is used to get current location list LocationInfo.

Returns
dictionary {location_id -> location_info}

Swift code snippet:

// Get current location list
let currentLocationList = manager.getLocationList()
print("Current location list contains \‍(currentLocationList.count) locations")
demonstrateLocationList(currentLocationList)

Objective C code snippet:

// Get current location list
NSDictionary<NSNumber *, NCLocationInfo *> *currentLocationList = [self.locationListManager getLocationList];
NSLog(@"Current location list contains %lu locations", (unsigned long)currentLocationList.count);
[self demonstrateLocationList:currentLocationList];

◆ removeLocationListListener:

- (void) removeLocationListListener: (nullable id< NCLocationListListener >) listener

Method is used for removing previously added LocationListListener class element.

Parameters
listenerСorresponding LocationListListener class to remove.

Swift code snippet:

// Remove location list listener
manager.removeLocationListListener(listener)
print("Removed location list listener")

Objective C code snippet:

// Remove location list listener
[self.locationListManager removeLocationListListener:self.locationListListener];
NSLog(@"Removed location list listener");

◆ updateLocationList

- (void) updateLocationList

Method is used to force reload location list.

Swift code snippet:

// Force reload location list
manager.updateLocationList()
print("Requested location list update")

Objective C code snippet:

// Force reload location list
[self.locationListManager updateLocationList];
NSLog(@"Requested location list update");

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