<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/EnvironmentValues/surfaceSnappingInfo",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI17EnvironmentValuesVAAE19surfaceSnappingInfoAA07SurfacefG0Vvp"
  },
  "title" : "surfaceSnappingInfo"
}
-->

# surfaceSnappingInfo

Provides information about the current snap state of the scene.

```
var surfaceSnappingInfo: SurfaceSnappingInfo { get }
```

## Discussion

Use the provided [`SurfaceSnappingInfo`](/documentation/SwiftUI/SurfaceSnappingInfo) from the environment to modify
the content of your view

```swift
struct LightFixtureView: View {
    @Environment(\.surfaceSnappingInfo)
    var snappingInfo: SurfaceSnappingInfo

    var body: some View {
        if snappingInfo.isSnapped {
            switch SurfaceSnappingInfo.authorizationStatus {
                case .authorized:
                    switch snappingInfo.classification {
                        case .table:
                            LampView()
                        case .floor:
                            FloorLampView()
                        default:
                            DefaultLampView()
                    }
                default:
                    DefaultLampView()
            }
        } else {
            FloatingOrbLampView()
        }
    }
}
```

This environment value should be accessed inside a view of your app, not
at the app or scene level. If you try to access this value at the scene
or app level it will always return the default value.

If you would like access to the classification of the surface a
scene is snapped to, the user must allow the app to access information
about their surroundings. In your app’s `Info.plist` you should set
`UIWantsDetailedSurfaceInfo` to `YES` and set
`NSWorldSensingUsageDescription` to provide a description of why your
app is requesting this information. The description will be displayed to
the user when they first snap a scene from your app.

---

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)