<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ARKit",
  "identifier" : "/documentation/ARKit/ARConfiguration/frameSemantics-swift.property",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "ARKit"
    ],
    "preciseIdentifier" : "c:objc(cs)ARConfiguration(py)frameSemantics"
  },
  "title" : "frameSemantics"
}
-->

# frameSemantics

The set of active semantics on the frame.

```
var frameSemantics: ARConfiguration.FrameSemantics { get set }
```

## Discussion

You can choose whether ARKit reports information about a particular per-frame metric, or *semantic*. Before enabling a frame sementic, call [`supportsFrameSemantics(_:)`](/documentation/ARKit/ARConfiguration/supportsFrameSemantics(_:)) to ensure device support.

### Enable 2D Body Detection

To get information about the 2D location of a person that ARKit recognizes in a frame, you enable the [`bodyDetection`](/documentation/ARKit/ARConfiguration/FrameSemantics-swift.struct/bodyDetection) frame semantic.

```swift
if let config = mySession.configuration as? ARBodyTrackingConfiguration {
    config.frameSemantics.insert(.bodyDetection)
    // Run the configuration to effect a frame semantics change.
    mySession.run(config)
}
```

### Enable People Occlusion

People occlusion is a feature that enables people in the camera feed to cover your app’s virtual content.

![Illustration showing two people standing in front of a virtual object. On the left, the person is partially occluded by the virtual object, breaking the illusion that the virtual object is actually placed in the physical environment. On the right, the person occludes the virtual object which maintains the illusion that the virtual object is actually placed in the physical environment. ](images/com.apple.arkit/media-3541708@2x.png)

To indicate that a person should overlap your app’s virtual content when the person is closer to the camera than the virtual content, add the <doc://com.apple.documentation/documentation/ARKit/ARConfiguration/FrameSemantics-swift.struct/personSegmentationWithDepth> option to your configuration’s frame semantics.

```swift
if let config = mySession.configuration as? ARWorldTrackingConfiguration {
    config.frameSemantics.insert(.personSegmentationWithDepth)
    // Run the configuration to effect a frame semantics change.
    mySession.run(config)
}
```

![Screenshot of two people in the camera feed with a virtual object between them. The person who’s in front of the virtual object occludes the virtual object, and the person behind the virtual object is occluded by the virtual object.](images/com.apple.arkit/media-3541707@2x.png)

To indicate that a person should overlap your app’s virtual content regardless of the person’s depth in the scene, use the
[`personSegmentation`](/documentation/ARKit/ARConfiguration/FrameSemantics-swift.struct/personSegmentation) frame semantic instead. This option is particularly appropriate for green-screen scenarios.

![Screenshot of two people in the camera feed standing in front of a virtual background.](images/com.apple.arkit/media-3541705@2x.png)

Standard renderers (<doc://com.apple.documentation/documentation/RealityKit/ARView>, and [`ARSCNView`](/documentation/ARKit/ARSCNView)) implement people occlusion for you. See [Occluding virtual content with people](/documentation/ARKit/occluding-virtual-content-with-people) for a sample app that demonstrates people occlusion in RealityKit.

If you implement your own renderer, use [`segmentationBuffer`](/documentation/ARKit/ARFrame/segmentationBuffer) and [`estimatedDepthData`](/documentation/ARKit/ARFrame/estimatedDepthData) to implement people occlusion yourself. [`ARMatteGenerator`](/documentation/ARKit/ARMatteGenerator) helps you by providing masks. For a sample app that demonstrates matte generator and people occlusion, see [Effecting People Occlusion in Custom Renderers](/documentation/ARKit/effecting-people-occlusion-in-custom-renderers).

If you enable Scene Reconstruction, ARKit adjusts the mesh according to any people ARKit may detect in the camera feed. ARKit removes any part of the scene mesh that overlaps with people, as defined by the with- or without-depth frame semantics. For more information about scene reconstruction, see [Visualizing and interacting with a reconstructed scene](/documentation/ARKit/visualizing-and-interacting-with-a-reconstructed-scene).

---

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)