IALocation

Objective-C


@interface IALocation : NSObject <IALatLngFloorCompatible>

Swift

class IALocation : NSObject, IALatLngFloorCompatible

An IALocation object represents the location data generated by an IALocationManager object. This object incorporates the geographical coordinates along with values indicating the accuracy of the measurements and when those measurements were made. This class also reports information about the the course, the direction in which the device is traveling.

Typically, you use an IALocationManager object to create instances of this class based on the last known location of the user’s device. You can create instances yourself, however, if you want to cache custom location data or get the distance between two points.

This class is designed to be used as is and should not be subclassed.

Initializing a Location Object

  • Initializes and returns a location object with specified CoreLocation information.

    An explicit location is used as a hint in the system. This means that the inputted location is used only to determine the initial position and setting the location does not lock the floor or venue context.

    Declaration

    Objective-C

    + (nonnull IALocation *)locationWithCLLocation:(nonnull CLLocation *)location;

    Swift

    /*not inherited*/ init(clLocation location: CLLocation)

    Parameters

    location

    CLLocation object. Might be initialized in code or from CLLocationManager.

  • Initializes and returns a location object with specified CoreLocation information.

    An explicit location is used as a hint in the system. This means that the inputted location is used only to determine the initial position and setting the location does not lock the floor or venue context.

    Declaration

    Objective-C

    + (nonnull IALocation *)locationWithCLLocation:(nonnull CLLocation *)location
                                          andFloor:(nullable IAFloor *)floor;

    Swift

    /*not inherited*/ init(clLocation location: CLLocation, andFloor floor: IAFloor?)

    Parameters

    location

    CLLocation object. Might be initialized in code or from CLLocationManager.

    floor

    IAFloor object with level information. Nil IAFloor means that the floor is unknown.

Location Attributes

  • CoreLocation compatible location information. (read-only)

    When running in the simulator, IALocationManager provides fake values. You must run your application on an actual iOS device to get the actual location of the device.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) CLLocation *location;

    Swift

    var location: CLLocation? { get }

Optional attributes

  • The logical floor of the building.

    This property is included as CLLocation’s CLFloor is private interface. Thus it may be deprecated in future.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) IAFloor *floor;

    Swift

    var floor: IAFloor? { get set }
  • Region this location was obtained from.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) IARegion *region;

    Swift

    var region: IARegion? { get set }
  • Experimental feature for soft location updates. The API may be changed in future. Set to true before giving as a custom location to IALocationManager to make the location behave more like radio source rather than a location hint.

    Declaration

    Objective-C

    @property (nonatomic) _Bool soft;

    Swift

    var soft: Bool { get set }