UABaseLocationProvider Class Reference
Inherits from | NSObject |
Conforms to | CLLocationManagerDelegate UALocationProviderProtocol |
Declared in | UABaseLocationProvider.h |
Overview
This is the base class for location providers. You should not implement this class directly. See the CLLocationManager documentation for details.
Tasks
NSObject
CLLocationManager related methods
-
locationManager
property -
maximumElapsedTimeForCachedLocation
property -
– distanceFilter
-
– setDistanceFilter:
-
– desiredAccuracy
-
– setDesiredAccuracy:
-
– purpose
-
– location
Location Service methods
-
delegate
property -
serviceStatus
property -
provider
property
Creating a UABaseLocationProvider
Location Accuracy
Starting and Stopping Location Services
Properties
delegate
Delegate that receives location updates
@property (nonatomic, weak, nullable) id<UALocationProviderDelegate> delegate
Declared In
UABaseLocationProvider.h
locationManager
Location manager used for providing location data. Setting this value has the side effect of assigning this class as the delegate of the new CLLocationManager
@property (nonatomic, strong) CLLocationManager *locationManager
Declared In
UABaseLocationProvider.h
maximumElapsedTimeForCachedLocation
In certain cases, cached values are immediately returned when starting a location service. Any location with a time interval older than this value will be considered invalid.
@property (nonatomic, assign) NSTimeInterval maximumElapsedTimeForCachedLocation
Declared In
UABaseLocationProvider.h
provider
Provider type must be set by subclasses
@property (nonatomic, copy) UALocationServiceProviderType *provider
Declared In
UABaseLocationProvider.h
serviceStatus
Status of the location service.
@property (nonatomic, assign) UALocationProviderStatus serviceStatus
Discussion
Possible UALocationProviderStatus values are:
Declared In
UABaseLocationProvider.h
Instance Methods
description
Returns a string that describes the contents of UABaseLocationProvider.
- (NSString *)description
Return Value
A string that describes UABaseLocationProvider.
Declared In
UABaseLocationProvider.h
desiredAccuracy
The desired accuracy currently set on the locationManager.
- (CLLocationAccuracy)desiredAccuracy
Declared In
UABaseLocationProvider.h
distanceFilter
The distance filter one the locationManager.
- (CLLocationDistance)distanceFilter
Declared In
UABaseLocationProvider.h
initWithDelegate:
Initializes the object with a delegate
- (instancetype)initWithDelegate:(nullable id<UALocationProviderDelegate>)delegate
Parameters
- delegate
Delegate object that implements the UALocationProviderDelegate protocol
Declared In
UABaseLocationProvider.h
location
The most recently received location available from the CLLocationManager object. This may be more accurate than the last reported location, and it may also be nil. See CLLocationManager documentation for more details.
- (nullable CLLocation *)location
Return Value
The most recent location, if one is available
nil if no recent location is available
Declared In
UABaseLocationProvider.h
locationChangeMeetsAccuracyRequirements:
Calculates location change accuracy
- (BOOL)locationChangeMeetsAccuracyRequirements:(CLLocation *)newLocation
Return Value
YES if the location meets accuracy requirements
NO if the location does not meet accuracy requirements
Declared In
UABaseLocationProvider.h
purpose
Purpose for location services shown to user when prompted to allow location services to begin. The default value is the NSLocationUsageDescription listed in the info.plist. This value cannot be set programatically.
- (nullable NSString *)purpose
Return Value
An NSString with the current purpose
Declared In
UABaseLocationProvider.h
setDesiredAccuracy:
Changes the desiredAccuracy on the locationManager.
- (void)setDesiredAccuracy:(CLLocationAccuracy)desiredAccuracy
Parameters
- desiredAccuracy
The new desiredAccuracy
Declared In
UABaseLocationProvider.h
setDistanceFilter:
Changes the distanceFilter on the locationManager.
- (void)setDistanceFilter:(CLLocationDistance)distanceFilter
Parameters
- distanceFilter
The new distance filter
Declared In
UABaseLocationProvider.h
startReportingLocation
Abstract method for starting the location service.
- (void)startReportingLocation
Discussion
Warning: This method only controls the service status on this object. A call to
[super startReportingLocation]
is required when overriding this method.
Declared In
UABaseLocationProvider.h
stopReportingLocation
Abstract method for stopping the location service.
- (void)stopReportingLocation
Discussion
Warning: This method only controls the service status on this object. A call to [super stopReportingLocation] is required when overriding this method.
Declared In
UABaseLocationProvider.h