SPLocation

@interface SPLocation : CLLocation

Extends CLLocation with extra metadata.

  • Recommended constructor for SPLocation objects

    Declaration

    Objective-C

    - (nonnull instancetype)initWithCoordinate:(CLLocationCoordinate2D)coordinate
                                         floor:(NSInteger)floor
                            horizontalAccuracy:(CLLocationAccuracy)hAccuracy
                                        course:(CLLocationDirection)course
                                        source:(SPLocationSource)source;

    Swift

    init(coordinate: CLLocationCoordinate2D, floor: Int, horizontalAccuracy hAccuracy: CLLocationAccuracy, course: CLLocationDirection, source: SPLocationSource)

    Parameters

    coordinate

    GPS coordinate

    floor

    index

    hAccuracy

    horizontal accuracy

    course

    degrees

    source

    location provider

    Return Value

    new instance of SPLocation

  • Constructor for SPLocation objects.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithCoordinate:(CLLocationCoordinate2D)coordinate
                                         floor:(NSInteger)floor
                            horizontalAccuracy:(CLLocationAccuracy)hAccuracy
                                        course:(CLLocationDirection)course;

    Swift

    init(coordinate: CLLocationCoordinate2D, floor: Int, horizontalAccuracy hAccuracy: CLLocationAccuracy, course: CLLocationDirection)

    Parameters

    coordinate

    GPS coordinate

    floor

    index

    hAccuracy

    horizontal accuracy

    course

    degrees

    Return Value

    new instance of SPLocation

  • Unique identifier for a building if location is determined to be inside a known building.

    Declaration

    Objective-C

    @property (readwrite, strong, nonatomic, nullable) NSString *building;

    Swift

    var building: String? { get set }
  • Use this to store any extra information about a location.

    Declaration

    Objective-C

    @property (readwrite, strong, nonatomic, nullable) NSString *info;

    Swift

    var info: String? { get set }
  • Modify the location source.

    Declaration

    Objective-C

    - (void)setSource:(SPLocationSource)source;

    Swift

    func setSource(_ source: SPLocationSource)

    Parameters

    source

    new source type

  • The source where this location was received. If no source was provided when the object was initialized, this will return ‘unknown’ by default.

    Declaration

    Objective-C

    - (SPLocationSource)source;

    Swift

    func source() -> SPLocationSource

    Return Value

    source location source type

  • Used for debug information.

    Declaration

    Objective-C

    - (void)setDebugData:(nonnull void *)data;

    Swift

    func setDebugData(_ data: UnsafeMutableRawPointer)

    Parameters

    data

    containing debug information