EPXProximityRange
@interface EPXProximityRange : NSObject
Represents range of a proximity where enter/exit events should occur.
Note:
Due to BLE signal instability the actual place where notifications occur will differ.
The meanTriggerDistance
value defines the desired mean of distance at which events occur.
The distance is rounded up to decimeters. Don’t expect decimeter accuracy; this is only for simplification of EPXProximityRange objects comparison.
-
Distance in meters where enter/exit events should occur passed in initializer rounded to decimeters (to 0.1).
Declaration
Objective-C
@property (readonly, assign, nonatomic) double desiredMeanTriggerDistance;
Swift
var desiredMeanTriggerDistance: Double { get }
-
Convenience factory for near range. Returns range with meanTriggerDistance set to 1m.
It’s a class property instead of class method to enable good-looking Swift code.
Declaration
Objective-C
@property (readonly, copy, nonatomic, class) EPXProximityRange *_Nonnull nearRange;
Swift
@NSCopying class var near: ProximityRange { get }
-
Convenience factory for far range. Returns range with meanTriggerDistance set to 5m.
It’s a class property instead of class method to enable good-looking Swift code.
Declaration
Objective-C
@property (readonly, copy, nonatomic, class) EPXProximityRange *_Nonnull farRange;
Swift
@NSCopying class var far: ProximityRange { get }
-
Unavailable
Init is disabled for this class.
Declaration
Objective-C
- (nonnull instancetype)init;
-
Unavailable
New is disabled for this class.
Declaration
Objective-C
+ (nonnull instancetype)new;
-
Designated initializer.
Declaration
Objective-C
- (nullable instancetype)initWithDesiredMeanTriggerDistance: (double)desiredMeanTriggerDistance;
Swift
init?(desiredMeanTriggerDistance: Double)
Parameters
desiredMeanTriggerDistance
Distance in meters where enter/exit events should occur rounded to decimeters (to 0.1). It has to be a non-negative number.
Return Value
Initialized object. Nil if passed desiredMeanTriggerDistance is negative.
-
Convenience factory method. Calls
-initWithMeanTriggerDistance:
.Declaration
Objective-C
+ (nullable instancetype)customRangeWithDesiredMeanTriggerDistance: (double)desiredMeanTriggerDistance;
Swift
class func custom(desiredMeanTriggerDistance: Double) -> Self?
Parameters
desiredMeanTriggerDistance
Distance in meters where enter/exit events should occur rounded to decimeters (to 0.1). It has to be a non-negative number.
Return Value
Initialized object. Nil if passed desiredMeanTriggerDistance is negative.
-
Undocumented
Declaration
Objective-C
- (BOOL)isEqualToRange:(EPXProximityRange *)otherRange;
Swift
func isEqual(to otherRange: ProximityRange) -> Bool
-
Undocumented
Declaration
Objective-C
- (BOOL)isEqual:(nullable id)otherObject;
Swift
func isEqual(_ otherObject: Any?) -> Bool
-
Undocumented
Declaration
Objective-C
- (NSUInteger)hash;
Swift
func hash() -> UInt