<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: -",
    "watchOS: 7.3.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "NearbyInteraction",
  "identifier" : "/documentation/NearbyInteraction/NINearbyObject/distance-676dm",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Nearby Interaction",
      "NearbyInteraction"
    ],
    "preciseIdentifier" : "s:So14NINearbyObjectC17NearbyInteractionE8distanceSfSgvp"
  },
  "title" : "distance"
}
-->

# distance

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

```
var distance: Float? { get }
```

## Discussion

This property contains the distance in meters between the local device and the peer device described by [`NINearbyObject`](/documentation/NearbyInteraction/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.

> Important:
> The framework doesn’t implement secure ranging, so don’t rely on Nearby Interaction to provide users with secure access, for example, security clearance, based on the value of this property.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)