iOS Developer Library

Developer

CoreLocation Framework Reference CLBeacon Class Reference

Options
Deployment Target:

On This Page
Language:

CLBeacon

The CLBeacon class represents a beacon that was encountered during region monitoring. You do not create instances of this class directly. The location manager object reports encountered beacons to its associated delegate object. You can use the information in a beacon object to identify which beacon was encountered.

The identity of a beacon is defined by its proximityUUID, major, and minor properties. These values are coded into the beacon itself. For a more thorough description of the meaning of those values, see CLBeaconRegion Class Reference.

Inheritance


Import Statement


Swift

import CoreLocation

Objective-C

@import CoreLocation;

Availability


Available in iOS 7.0 and later.
  • The proximity ID of the beacon. (read-only)

    Declaration

    Swift

    var proximityUUID: NSUUID! { get }

    Objective-C

    @property(readonly, nonatomic, strong) NSUUID *proximityUUID

    Import Statement

    Objective-C

    @import CoreLocation;

    Swift

    import CoreLocation

    Availability

    Available in iOS 7.0 and later.

  • major major Property

    The most significant value in the beacon. (read-only)

    Declaration

    Swift

    var major: NSNumber! { get }

    Objective-C

    @property(readonly, nonatomic, strong) NSNumber *major

    Import Statement

    Objective-C

    @import CoreLocation;

    Swift

    import CoreLocation

    Availability

    Available in iOS 7.0 and later.

  • minor minor Property

    The least significant value in the beacon. (read-only)

    Declaration

    Swift

    var minor: NSNumber! { get }

    Objective-C

    @property(readonly, nonatomic, strong) NSNumber *minor

    Import Statement

    Objective-C

    @import CoreLocation;

    Swift

    import CoreLocation

    Availability

    Available in iOS 7.0 and later.

  • proximity proximity Property

    The relative distance to the beacon. (read-only)

    Declaration

    Swift

    var proximity: CLProximity { get }

    Objective-C

    @property(readonly, nonatomic) CLProximity proximity

    Discussion

    The value in this property gives a general sense of the relative distance to the beacon. Use it to quickly identify beacons that are nearer to the user rather than farther away.

    Import Statement

    Objective-C

    @import CoreLocation;

    Swift

    import CoreLocation

    Availability

    Available in iOS 7.0 and later.

  • accuracy accuracy Property

    The accuracy of the proximity value, measured in meters from the beacon. (read-only)

    Declaration

    Swift

    var accuracy: CLLocationAccuracy { get }

    Objective-C

    @property(readonly, nonatomic) CLLocationAccuracy accuracy

    Discussion

    Indicates the one sigma horizontal accuracy in meters. Use this property to differentiate between beacons with the same proximity value. Do not use it to identify a precise location for the beacon. Accuracy values may fluctuate due to RF interference.

    A negative value in this property signifies that the actual accuracy could not be determined.

    Import Statement

    Objective-C

    @import CoreLocation;

    Swift

    import CoreLocation

    Availability

    Available in iOS 7.0 and later.

  • rssi rssi Property

    The received signal strength of the beacon, measured in decibels. (read-only)

    Declaration

    Swift

    var rssi: Int { get }

    Objective-C

    @property(readonly, nonatomic) NSInteger rssi

    Discussion

    This value is the average RSSI value of the samples received since the range of the beacon was last reported to your app.

    Import Statement

    Objective-C

    @import CoreLocation;

    Swift

    import CoreLocation

    Availability

    Available in iOS 7.0 and later.

  • Constants that reflect the relative distance to a beacon.

    Declaration

    Swift

    enum CLProximity : Int { case Unknown case Immediate case Near case Far }

    Objective-C

    typedef { CLProximityUnknown, CLProximityImmediate, CLProximityNear, CLProximityFar } CLProximity;

    Constants

    • Unknown

      CLProximityUnknown

      The proximity of the beacon could not be determined.

      Available in iOS 7.0 and later.

    • Immediate

      CLProximityImmediate

      The beacon is in the user’s immediate vicinity.

      Available in iOS 7.0 and later.

    • Near

      CLProximityNear

      The beacon is relatively close to the user.

      Available in iOS 7.0 and later.

    • Far

      CLProximityFar

      The beacon is far away.

      Available in iOS 7.0 and later.

    Import Statement

    Objective-C

    @import CoreLocation;

    Swift

    import CoreLocation

    Availability

    Available in iOS 7.0 and later.