Contents

distance

The distance from the user’s device to the peer device in meters.

Declaration

var distance: Float? { get }

Mentioned in

Discussion

This property contains the distance in meters between the local device and the peer device described by NINearbyObject. If the framework fails to acquire the peer device’s distance, the value is nil.

The maximum detectable range depends on environmental factors. For example, a clear path between the two devices increases the detectable range, and solid obstructions to the device’s line of sight constrict the range.