<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "watchOS: 7.3.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "NearbyInteraction",
  "identifier" : "/documentation/NearbyInteraction/NINearbyObject",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Nearby Interaction"
    ],
    "preciseIdentifier" : "c:objc(cs)NINearbyObject"
  },
  "title" : "NINearbyObject"
}
-->

# NINearbyObject

Location information for a peer device in an interaction session.

```
class NINearbyObject
```

## Overview

A nearby object refers to a peer Apple device or third-party accessory.

When the framework is ready to provide your app with information about a nearby object’s relative position, it calls your delegate’s [`session(_:didUpdate:)`](/documentation/NearbyInteraction/NISessionDelegate/session(_:didUpdate:)) implementation.

If a session can’t provide peer direction or distance, it sets the values to `nil`. In Objective-C, the session uses the [`NINearbyObjectDirectionNotAvailable`](/documentation/NearbyInteraction/NINearbyObjectDirectionNotAvailable) and [`NINearbyObjectDistanceNotAvailable`](/documentation/NearbyInteraction/NINearbyObjectDistanceNotAvailable) values to indicate missing direction or distance.

For more information, see [Initiating and maintaining a session](/documentation/NearbyInteraction/initiating-and-maintaining-a-session).

## Topics

### Identifying a nearby device

[`discoveryToken`](/documentation/NearbyInteraction/NINearbyObject/discoveryToken)

A unique identifier for a peer device in the session.

### Acquring relative distance

[`distance`](/documentation/NearbyInteraction/NINearbyObject/distance-676dm)

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

[`distance`](/documentation/NearbyInteraction/NINearbyObject/distance-9atp7)

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

[`NINearbyObjectDistanceNotAvailable`](/documentation/NearbyInteraction/NINearbyObjectDistanceNotAvailable)

An object that indicates the peer’s distance is unavailable.

### Acquiring relative direction

[`direction`](/documentation/NearbyInteraction/NINearbyObject/direction-4qh5w)

A vector that points from the user’s device in the direction of the peer device.

[`horizontalAngle`](/documentation/NearbyInteraction/NINearbyObject/horizontalAngle-hsg)

An angle in radians that indicates the azimuthal direction to the nearby object.

[`direction`](/documentation/NearbyInteraction/NINearbyObject/direction-5xcld)

A vector that points from the user’s device in the direction of the peer device.

[`NINearbyObjectDirectionNotAvailable`](/documentation/NearbyInteraction/NINearbyObjectDirectionNotAvailable)

A value that indicates that a nearby object’s direction is unavailable.

[`horizontalAngle`](/documentation/NearbyInteraction/NINearbyObject/horizontalAngle-9ibky)

An angle in radians that indicates the azimuthal direction to the nearby object.

[`NINearbyObjectAngleNotAvailable`](/documentation/NearbyInteraction/NINearbyObjectAngleNotAvailable)

A value that indicates that a nearby object’s horizontal angle is unavailable.

[`verticalDirectionEstimate`](/documentation/NearbyInteraction/NINearbyObject/verticalDirectionEstimate-swift.property)

The estimation of a nearby object’s vertical position as it relates to the user’s device.

[`NINearbyObject.VerticalDirectionEstimate`](/documentation/NearbyInteraction/NINearbyObject/VerticalDirectionEstimate-swift.enum)

Estimations of a nearby object’s vertical position in relation to the user’s device.

### Explaining participation

[`NINearbyObject.RemovalReason`](/documentation/NearbyInteraction/NINearbyObject/RemovalReason)

The reason a session removed a nearby object.



---

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)