Inherits from VMRequestManager : NSObject
Declared in VMLocationsManager.h
VMLocationsManager.m

Overview

VMLocationsManager is a subclass of VMRequestManager providing methods for getting the states and cities lists. This API should be used to select a location if gps/network location is not available on mobile device.

Tasks

Properties

currentLocation

Current location.

@property (readonly, nonatomic, strong) CLLocation *currentLocation

Declared In

VMLocationsManager.h

isUpdatingLocation

Read-only variable showing if location is being updated: YES if the location is being updated, else NO.

@property (nonatomic, readonly) BOOL isUpdatingLocation

Declared In

VMLocationsManager.h

updateLocationTimeInterval

Read-only variable showing the Time interval for updating location.

@property (nonatomic, readonly) NSTimeInterval updateLocationTimeInterval

Declared In

VMLocationsManager.h

Class Methods

sharedInstance

Returns the shared locations manager object for the system.

+ (instancetype)sharedInstance

Return Value

The systemwide locations manager.

Declared In

VMLocationsManager.h

Instance Methods

citiesListWithCompletionBlock:failBlock:

Provides a list of all Cities.

- (VMHTTPRequestOperation *)citiesListWithCompletionBlock:(ObjectBlock)completionBlock failBlock:(ErrorBlock)errorBlock

Parameters

completionBlock

The block to be executed on the completion of a successful request. This block has no return value and takes one argument: the object constructed from the response data of the request.

errorBlock

The block to be executed on the completion of an unsuccessful request. This block has no return value and takes one argument: the error that occurred during the request.

Return Value

A new request operation.

Declared In

VMLocationsManager.h

setUpdateActivityLocation:

Set block called on adding current location to activity batch

- (void)setUpdateActivityLocation:(ObjectBlock)updateActivityLocationBlock

Parameters

updateActivityLocationBlock

block called on adding current location to activity batch

Declared In

VMLocationsManager.h

setUpdateErrorBlock:

Set block called on errorreceived when updating location

- (void)setUpdateErrorBlock:(ErrorBlock)errorBlock

Parameters

errorBlock

block called on errorreceived when updating location

Declared In

VMLocationsManager.h

setUpdateLocation:

Set block called on successful location update

- (void)setUpdateLocation:(ObjectBlock)updateLocationBlock

Parameters

updateLocationBlock

block called on successful location update

Declared In

VMLocationsManager.h

startLocation

Start updating locations.

- (void)startLocation

Declared In

VMLocationsManager.h

startLocationWithCompletionBlock:failBlock:

Start updating locations.

- (void)startLocationWithCompletionBlock:(ObjectBlock)updateLocationBlock failBlock:(ErrorBlock)errorBlock

Parameters

updateLocationBlock

block called on successful location update

errorBlock

block called on errorreceived when updating location

Declared In

VMLocationsManager.h

statesListWithCompletionBlock:failBlock:

Provides a list of all States.

- (VMHTTPRequestOperation *)statesListWithCompletionBlock:(ObjectBlock)completionBlock failBlock:(ErrorBlock)errorBlock

Parameters

completionBlock

The block to be executed on the completion of a successful request. This block has no return value and takes one argument: the object constructed from the response data of the request.

errorBlock

The block to be executed on the completion of an unsuccessful request. This block has no return value and takes one argument: the error that occurred during the request.

Return Value

A new request operation.

Declared In

VMLocationsManager.h

stopLocation

Stop updating locations.

- (void)stopLocation

Declared In

VMLocationsManager.h