---
title: Implementing spatial interactions with third-party accessories
framework: nearbyinteraction
role: sampleCode
role_heading: Sample Code
path: nearbyinteraction/implementing-spatial-interactions-with-third-party-accessories
---

# Implementing spatial interactions with third-party accessories

Establish a connection with a nearby accessory to receive periodic measurements of its distance from the user.

## Overview

Overview note: This sample code project is associated with WWDC21 session 10165: Explore Nearby Interaction with Third-Party Accessories. Configure the Sample Code Project Set the run destination to an iPhone that contains an Ultra Wideband chip. The sample app interacts with an accessory you partner with or develop using the Nearby Interaction Accessory Protocol Specification.

## See Also

### Third-party accessories

- [NINearbyAccessoryConfiguration](nearbyinteraction/ninearbyaccessoryconfiguration.md)
- [NIMotionActivityState](nearbyinteraction/nimotionactivitystate.md)
