---
title: "setARSession(_:)"
framework: nearbyinteraction
role: symbol
role_heading: Instance Method
path: "nearbyinteraction/nisession/setarsession(_:)"
---

# setARSession(_:)

Provides the framework with an existing AR session to use for Camera Assistance.

## Declaration

```swift
func setARSession(_ session: ARSession)
```

## Parameters

- `session`: An existing AR session configured as follows: A world-tracking configuration (doc://com.apple.documentation/documentation/ARKit/ARWorldTrackingConfiguration) with doc://com.apple.documentation/documentation/ARKit/ARConfiguration/worldAlignment-swift.property = doc://com.apple.documentation/documentation/ARKit/ARConfiguration/WorldAlignment-swift.enum/gravity, doc://com.apple.documentation/documentation/ARKit/ARWorldTrackingConfiguration/isCollaborationEnabled = false, doc://com.apple.documentation/documentation/ARKit/ARWorldTrackingConfiguration/userFaceTrackingEnabled = false, and doc://com.apple.documentation/documentation/ARKit/ARWorldTrackingConfiguration/initialWorldMap = nil. A delegate that returns false for doc://com.apple.documentation/documentation/ARKit/ARSessionObserver/sessionShouldAttemptRelocalization(_:).

## Discussion

Discussion Set the isCameraAssistanceEnabled flag to true before calling this function. If you enable the flag and run a nearby-interaction session without calling setARSession(_:), the framework creates an internal ARSession instance to which the app has no access.

## See Also

### Utilizing Camera Assistance

- [worldTransform(for:)](nearbyinteraction/nisession/worldtransform(for:).md)
